• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Script to restart the OT at a certain time

Cornwallis

Member
Joined
Jan 3, 2010
Messages
480
Reaction score
16
Is there a way that you can make a script to close the ot and then run it again at the same time everyday?
 
config.lua

Code:
globalSaveEnabled = false
globalSaveHour = 8
globalSaveMinute = 0
shutdownAtGlobalSave = true
cleanMapAtGlobalSave = false
 
LUA:
function onThink(cid,interval)	
	doSetGameState(GAMESTATE_SHUTDOWN)
	return false
end

LUA:
<globalevent name="shutdown" time="21:00" event="script" value="my_script.lua"/>
 
LUA:
function onThink(cid,interval)	
	doSetGameState(GAMESTATE_SHUTDOWN)
	return false
end

LUA:
<globalevent name="shutdown" time="21:00" event="script" value="my_script.lua"/>

LUA:
function onThink(cid,interval)	
        return doSetGameState(GAMESTATE_SHUTDOWN)
end
 
I think a script would be better because then i can make it so it gives a fair warning that there will be a server shutdown, but ill see what i can do.
 
I think a script would be better because then i can make it so it gives a fair warning that there will be a server shutdown, but ill see what i can do.

LUA:
function onThink(cid,interval)
	doBroadcastMessage('shutdown in 5 minutes.')
	return addEvent(onShutdown,5*60*1000)
end

function onShutdown()
	return false doSetGameState(GAMESTATE_SHUTDOWN)
end

And don't triple post, that's lame.
 
Back
Top