• 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!

Windows shutdown server

Tampek

ECHO 'Zarkonia.online';
Joined
Dec 29, 2015
Messages
478
Solutions
5
Reaction score
33
Location
Spain
Hello i have some problems with tfs, when server save is done and goes to shutdown program not closes and i need enter to the vps and do it manual.
It sometimes happens, yesterday disable "has stopped working message popup" from regedit and works perfect but console still not closes/shutdown process to reopen again like ss.

Anyone know what can do?

Cheers! ❤
 
XML:
<globalevent name="Server Save" time="09:55:00" script="serversave.lua" />
Lua:
local shutdownAtServerSave = false
local cleanMapAtServerSave = true

local function serverSave()
    if shutdownAtServerSave then
        Game.setGameState(GAME_STATE_SHUTDOWN)
    else
        Game.setGameState(GAME_STATE_CLOSED)

        if cleanMapAtServerSave then
            cleanMap()
        end

        Game.setGameState(GAME_STATE_NORMAL)
    end
end

local function secondServerSaveWarning()
    broadcastMessage("Server is saving game in one minute. Please logout.", MESSAGE_STATUS_WARNING)
    addEvent(serverSave, 60000)
end

local function firstServerSaveWarning()
    broadcastMessage("Server is saving game in 3 minutes. Please logout.", MESSAGE_STATUS_WARNING)
    addEvent(secondServerSaveWarning, 120000)
end

function onTime(interval)
    broadcastMessage("Server is saving game in 5 minutes. Please logout.", MESSAGE_STATUS_WARNING)
    Game.setGameState(GAME_STATE_STARTUP)
    addEvent(firstServerSaveWarning, 120000)
    return not shutdownAtServerSave
end
or use
XML:
<globalevent name="Server Save" interval="3600000" script="server_save.lua" />
Lua:
function onThink(interval)
    saveServer()

    return true
end
with out shutdown
 
Back
Top