local shutdownAtServerSave = false
local cleanMapAtServerSave = false
local function serverSave()
if shutdownAtServerSave then
Game.setGameState(GAME_STATE_SHUTDOWN)
end
if cleanMapAtServerSave then
cleanMap()
end
saveServer()
Game.setGameState(GAME_STATE_NORMAL)
end
function onThink(interval)
addEvent(serverSave, 1)
return not shutdownAtServerSave
end