LU
pedido

Auto Save

Por lugk123, 07 de out. de 2012 em Scripts

3
1.4k
lugk123L
07 de outubro de 2012 às 16:52

Preciso de um auto save, pois no do OT que baixei não está pegando.(globalevents save.lua)

15790911
07 de outubro de 2012 às 17:04

No globalevents, no save.lua coloque isso:

 

 

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 Vai Ser Salvo Em " .. seconds .. " Seg, Save Server!"

doBroadcastMessage(text)

end

 

if(seconds > 0) then

addEvent(executeSave, config.events * 1, 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

 

 

 

Depois em globalevents.xml:

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

lugk123L
07 de outubro de 2012 às 17:57

Valeu GuizitoG, deu certinho. +REPPP