Veja se é o que vc quer:
local config = {
broadcast = {120, 30},
shallow = "no",
delay = 120,
events = 30
}
config.shallow = getBooleanFromString(config.shallow)
local function executeSave(seconds)
if(isInArray(config.broadcast, seconds)) then
local text = ""
if(not config.shallow) then
text = "Full s"
else
text = "S"
end
text = text .. "erver save within " .. seconds .. " seconds, please mind it may freeze!" onThink(interval, lastExecution, thinkInterval) doBroadcastMessage("Game save within XXXX seconds!")
doBroadcastMessage(text)
end
if(seconds > 0) then
addEvent(executeSave, config.events * 1000, seconds - config.events)
else
doSaveServer(config.shallow)
end
end
function onThink(interval, lastExecution, thinkInterval)
if(table.maxn(config.broadcast) == 0) then
doSaveServer(config.shallow)
else
executeSave(config.delay)
end
return true
end
Ae em XXXX vc coloca o tempo q vai salvar.
Se não funcionar me avisa.








info
Grupo: Artesão
Registrado: 16/01/09
Posts: 140
Reputação: +50
Char no Tibia: Eternal Oblivion
Ola galera,venho pedir algo bem simples pra quem entende do assunto..
é sobre o save do server
queria que uns 2 segundos antes de salvar,manda-se uma msg avisando tipo [server Salvando]
ai depois do save,mandava a msg de [server Salvo]
Script aqui!
local config = { broadcast = {120, 30}, shallow = "no", delay = 120, events = 30 } config.shallow = getBooleanFromString(config.shallow) local function executeSave(seconds) if(isInArray(config.broadcast, seconds)) then local text = "" if(not config.shallow) then text = "Full s" else text = "S" end text = text .. "erver save within " .. seconds .. " seconds, please mind it may freeze!" doBroadcastMessage(text) end if(seconds > 0) then addEvent(executeSave, config.events * 1000, seconds - config.events) else doSaveServer(config.shallow) end end function onThink(interval, lastExecution, thinkInterval) if(table.maxn(config.broadcast) == 0) then doSaveServer(config.shallow) else executeSave(config.delay) end return true endEditado Outubro 8 por soldoran