Ir para conteúdo

Featured Replies

  • Respostas 5
  • Visualizações 887
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Se for em milissegundos segundos é simples 1 segundo = 1000 milissegundos 60 segundos = 1 hora 60 segundos = 60.000 milissegundos 1 hora = 60 minutos 60000 x 60 = 3600000   Então se for em milissegund

Postado

aew amigo tente usar essa talvez funcione ^^

 

data/globalevents/scripts/ crie um arquivo.lua

 

Mostrar conteúdo oculto

function executeSave()


broadcastMessage("Servidor salvo próximo salve em 1 hora.", 25)
doSaveServer()
end

function onThink(interval, lastExecution, thinkInterval)
broadcastMessage("Servidor será salvo em 5 segundos.", 25)
addEvent(executeSave, 5 * 1000)
return true
end

 

depois vá em globalevents.xml

<globalevent name="save" interval="3600" event="script" value="save.lua"/>

 

bom para mudar sugiro usar este site ele é bom apenas para converter os segundos ^^

 

clique aqui!

Postado
Se for em milissegundos segundos é simples
1 segundo = 1000 milissegundos
60 segundos = 1 hora
60 segundos = 60.000 milissegundos
1 hora = 60 minutos
60000 x 60 = 3600000
 
Então se for em milissegundos mude a tag do globalevents.xml para:
  Citar

<globalevent name="save" interval="3600000" event="script" value="save.lua"/>
 
 
EDIT---
Você devia ter falado qual era sua versão :)
Nunca mudei de versão dez da 0.4...
Creditos: luanluciano93

Tenta esse script aqui:
  Citar
-- <globalevent name="Server interval="900000" script="serversave.lua"/> -- 900000 = 15 MIN

local shutdownAtServerSave = false
local cleanMapAtServerSave = false

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

    if cleanMapAtServerSave then
        cleanMap()
    end

    saveServer()
end

local function secondServerSaveWarning()
    broadcastMessage("
Server is saving game in one minute. Please go to a safe place.", MESSAGE_STATUS_WARNING)
    addEvent(serverSave, 60000)
end

local function firstServerSaveWarning()
    broadcastMessage("
Server is saving game in 3 minutes. Please go to a safe place.", MESSAGE_STATUS_WARNING)
    addEvent(secondServerSaveWarning, 120000)
end

function onThink(interval)
    broadcastMessage("
Server is saving game in 5 minutes. Please go to a safe place.", MESSAGE_STATUS_WARNING)
    Game.setGameState(GAME_STATE_STARTUP)
    addEvent(firstServerSaveWarning, 120000)
    return not shutdownAtServerSave
end

Editado por tddf1995 (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo