function prepareShutdown(minutes) if(minutes <= 0) then
doSetGameState(GAMESTATE_CLOSED)
return false
end
if(minutes == 1) then
doBroadcastMessage("Server is going down in " .. minutes .. " minute for global save, please log out now!")
elseif(minutes <= 3) then
doBroadcastMessage("Server is going down in " .. minutes .. " minutes for global save, please log out.")
else
doBroadcastMessage("Server is going down in " .. minutes .. " minutes for global save.")
end
shutdownEvent = addEvent(prepareShutdown, 60000, minutes - 1)
return true
end
function onTime(interval)
if os.date('%H') == "3" and getWorldUpTime() > 20*60*60 then
return prepareShutdown(10)
end
return TRUE
end
Pergunta
bundalisa 1
save.lua
function prepareShutdown(minutes) if(minutes <= 0) then doSetGameState(GAMESTATE_CLOSED) return false end if(minutes == 1) then doBroadcastMessage("Server is going down in " .. minutes .. " minute for global save, please log out now!") elseif(minutes <= 3) then doBroadcastMessage("Server is going down in " .. minutes .. " minutes for global save, please log out.") else doBroadcastMessage("Server is going down in " .. minutes .. " minutes for global save.") end shutdownEvent = addEvent(prepareShutdown, 60000, minutes - 1) return true end function onTime(interval) if os.date('%H') == "3" and getWorldUpTime() > 20*60*60 then return prepareShutdown(10) end return TRUE end
Estou fazendo alguma coisa errada?
chega no horário e não aparece nenhuma mensagem
+rep
Link para o comentário
Compartilhar em outros sites
3 respostass a esta questão
Posts Recomendados