- Joined
- Jun 19, 2009
- Messages
- 1,852
- Reaction score
- 5
Sorry for asking help for this.. feeling noob but
I want the server save every.. 50 min
Code:
local config = {
broadcast = {120, 35},
shallow = "no",
delay = 120,
events = 35
}
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
I want the server save every.. 50 min