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

Need admin /save command

SixNine

Active Member
Joined
Dec 12, 2018
Messages
442
Reaction score
40
Hi,
is there command that when you type /save it would send warnings like
Server Save In 5 Minutes
Server Save In 3 Minutes
Server Save In 1 Minutes
And it would save everyone and reload whole data file and kick all players. The reason for it if you do changes in data like map it would reload all data files. Ofc if its possible if not you can give just a simple /save command that saves players.

TFS 1.2
 
Hi,
is there command that when you type /save it would send warnings like
Server Save In 5 Minutes
Server Save In 3 Minutes
Server Save In 1 Minutes
And it would save everyone and reload whole data file and kick all players. The reason for it if you do changes in data like map it would reload all data files. Ofc if its possible if not you can give just a simple /save command that saves players.

TFS 1.2
Use the serversave.lua in globalevents and just change the onTime/onThink to an onSay function then register it as /save in talkactions.xml.
 
Tested on TFS 1.0


Code:
local shutdownAtServerSave = false
local cleanMapAtServerSave = false

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("Apoca is saving game in one minute.", MESSAGE_STATUS_WARNING)
    addEvent(serverSave, 60000)
end

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

function onSay(cid, words)
    broadcastMessage("Apoca is saving game in 5 minutes.", MESSAGE_STATUS_WARNING)
    Game.setGameState(GAME_STATE_STARTUP)
    addEvent(firstServerSaveWarning, 120000)
    return not shutdownAtServerSave
end
 
Last edited:
Back
Top