• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Auto Server Save!!

@UP: I think you can only have one login.lua script, so use this:
Code:
local minute = 10 -- interval in minutes
local minutes = minute * 60 * 1000 -- dont edit

function onLogin(cid)
	registerCreatureEvent(cid, "PlayerDeath")
	if(alryInitServSave == 0) then
		local eventServ = addEvent(autoSavePlayers, minutes, {})
		alryInitServSave = eventServ
	end
	return 1
end

function autoSavePlayers(parameters)
	savePlayers()
	print("Server save...")
	local eventServ = addEvent(autoSavePlayers, minutes, parameters)
	alryInitServSave = eventServ
end

@Topic: I love this script, thank you =)
 
I neeed auto Server save (houses save and all other stuff)
i need it really men!
could anyone script to me ? ;s

Just change `savePlayers()` to `saveData()` in this script.
 
thank you very marcinek i very thankfull u help me by all stuff u have helped me to grow my server up x)
local minute = 30 -- interval in minutes
local minutes = minute * 60 * 1000 -- dont edit

function onLogin(cid)
if(alryInitServSave == 0) then
local eventServ = addEvent(autoSavePlayers, minutes, {})
alryInitServSave = eventServ
end
return 1
end

function autoSavePlayers(parameters)
saveData()
print("Server save...")
local eventServ = addEvent(autoSavePlayers, minutes, parameters)
alryInitServSave = eventServ
end
will this work?
i use latest rev 0.2.9 from 8.2.2008
 
Last edited:
thank you very marcinek i very thankfull u help me by all stuff u have helped me to grow my server up x)

will this work?
i use latest rev 0.2.9 from 8.2.2008

I think it should. Seems to work for me...

//Massen
 
Why do you use onLogin? Just place it witn an addEvent in global.lua with a global storage value and it'll be great, like I did with my auto broadcaster ^.-
 
Just wanted to make it possible for people without gloabal.lua to be able to use this script. Just make it this. (btw made it so saves everything).
*NOTE* If you have a globalevents.lua. You need to make "save" Intrival"0"
Make sure in config.lua you dont have anything saving. Just make anything with save = "0"

local minute = 10 -- interval in minutes
local minutes = minute * 60 * 1000 -- dont edit

function onLogin(cid)
if (not isPlayerGhost(cid)) then
local eventServ = addEvent(autoSavePlayers, minutes, {})
alryInitServSave = eventServ
end
return 1
end

function autoSavePlayers(parameters)
savePlayers()
saveData()
print("Server save...")
local eventServ = addEvent(autoSavePlayers, minutes, parameters)
alryInitServSave = eventServ
end
 
Last edited:
Back
Top