Sultinho
www.titania-global.com
- Joined
- May 20, 2009
- Messages
- 109
- Reaction score
- 2
I saw on a server a server save which selected players online and save not all at once but for example 50 to 50 players or decreasing the freeze. Of course, giving a range between these saves it would be possible?
The original script of server save:
The original script of server save:
Code:
local config = {
broadcast = {120, 30},
flags = 13,
delay = 120,
events = 30
}
local function executeSave(seconds)
if(isInArray(config.broadcast, seconds)) then
doBroadcastMessage("Server save within " .. seconds .. " seconds, please mind it may freeze!")
end
if(seconds > 0) then
addEvent(executeSave, config.events * 1000, seconds - config.events)
else
doSaveServer(config.flags)
end
end
function onThink(interval)
if(table.maxn(config.broadcast) == 0) then
doSaveServer(config.flags)
else
executeSave(config.delay)
end
return true
end