GU
dúvida

Server save

Por guigiannoni, 20 de ago. de 2015 em Archived

save
3
1k
guigiannoniG
20 de agosto de 2015 às 11:44

Meu servidor não salva automaticamente, como adicionar?

SkyLighS
20 de agosto de 2015 às 11:47

vá em data/globalevents/talkactions.xml e adicione esta tag

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

vá em data/globalevents/scripts e crie um arquivo.lua chamado save.lua e adicione esse código dentro :

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

LumusL
20 de agosto de 2015 às 11:50

Tópico repetido.

 

Movido para lixeira.

 

Link do outro tópico já respondido:http://www.xtibia.com/forum/topic/236370-server-save/