/closeserver shutdown
shutdown 5 and server restart in 5 minutes/closeserver shutdown
nice but i use linuxWell you use the shutdown command.. then let an external program restart the program for you.
Here's the program I've used in the past.
https://goo.gl/MiEWN4 -- download
https://goo.gl/DQGt0a -- Virus Total for Website
https://goo.gl/nxxEXu -- Virus Total for File
edit --
Apparently google url shortner has a conflict with terms of use for downloadable content?
anyways here's the direct link for the download
http://1drv.ms/1j4NVry
Use the command @Tarek1337 said and create a shell script that handles the restart.bump
while true; do ./tfs; done
local function shutdownServer()
Game.setGameState(GAME_STATE_SHUTDOWN)
end
local function shutdownMessage(timeLeft)
if timeLeft == 1 then
broadcastMessage("Server is going down in 1 minute. Please logout.", MESSAGE_STATUS_WARNING)
addEvent(shutdownServer, 1 * 60 * 1000)
return
end
broadcastMessage("Server is going down in ".. timeLeft .." minutes. Please logout.", MESSAGE_STATUS_WARNING)
shutdownEvent = addEvent(shutdownMessage, 1 * 60 * 1000, timeLeft - 1)
end
local SHUTDOWN_STATE = false
function onSay(player, words, param)
if not player:getGroup():getAccess() then
return true
end
if param == "kill" then
os.exit()
return false
end
if SHUTDOWN_STATE then
if param == "cancel" or param == "stop" then
broadcastMessage("Shutdown event has been stopped. Sorry for the inconvenience.", MESSAGE_STATUS_WARNING)
SHUTDOWN_STATE = false
stopEvent(shutdownEvent)
else
player:sendCancelMessage("Server is already in a shutdown state. To cancel shutdown use the \"/shutdown stop\" command.")
end
return false
end
local number = tonumber(param)
if not number then
player:sendCancelMessage("Numeric param may not be lower than 0.")
return false
end
if number == 0 then
shutdownServer()
return false
end
shutdownMessage(number)
SHUTDOWN_STATE = true
return false
end
errorCode:local function shutdownServer() Game.setGameState(GAME_STATE_SHUTDOWN) end local function shutdownMessage(timeLeft) if timeLeft == 1 then broadcastMessage("Server is going down in 1 minute. Please logout.", MESSAGE_STATUS_WARNING) addEvent(shutdownServer, 1 * 60 * 1000) return end broadcastMessage("Server is going down in ".. timeLeft .." minutes. Please logout.", MESSAGE_STATUS_WARNING) shutdownEvent = addEvent(shutdownMessage, 1 * 60 * 1000, timeLeft - 1) end function onSay(player, words, param) local number = tonumber(param) if number then if number == 0 then shutdownServer() return false end end if Game.getGameState() == GAME_STATE_CLOSED then if param ~= "" then if param == "cancel" or param == "stop" then broadcastMessage("Shutdown event has been stopped. Sorry for the inconvenience.", MESSAGE_STATUS_WARNING) Game.setGameState(GAME_STATE_NORMAL) stopEvent(shutdownEvent) elseif param == "kill" then os.exit() end return false end player:sendCancelMessage("Server is already in a shutdown state. To cancel shutdown use the \"/shutdown stop\" command.") return false end shutdownMessage(number) Game.setGameState(GAME_STATE_CLOSED) return false end
can you explain im newbieUse the command @Tarek1337 said and create a shell script that handles the restart.
Code:while true; do ./tfs; done
Just use printer's script, then use command /shutdown 5 like you originally wanted to.error
can you explain im newbie
I try and got error look upJust use printer's script, then use command /shutdown 5 like you originally wanted to.
don't workRecopy the code and also execute it as @Codex NG wrote.