Ok, então vai em data/globalevents/scripts, crie um arquivo chamado save.lua e adicione:
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
end
Agora em globalevents.xml, adicione essa tag:
<globalevent name="save" interval="1800" event="script" value="save.lua"/>
Prontinho, meia hora
)
Praticamente você itendeu quase tudo agora falta usar como base a outra script no lugar dessa que você mencionou . a script que postei acima





info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino
Ok, então vai em data/globalevents/scripts, crie um arquivo chamado save.lua e adicione:
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
end
Agora em globalevents.xml, adicione essa tag:
Prontinho, meia hora
)