• 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!

My !serversave Command.

Jgarder

Tprogramming Ex-Adm|n
Premium User
Joined
Jun 7, 2007
Messages
355
Reaction score
3
Location
Michigan
My /serversave command has recently stopped working.. MAYBE at the same as a recent revision update.. was there any code changes to anything related to data saving???.. (no errors are thrown in the Console.. but no serversave happens)
 
hmm.. but i im still wondering if anything has changed that would possibly make my script not work..
 
savePlayers() has been changed to saveData()
 
yea sure..
i still have no idea what became outdated to make this script not work at all.. but perhaps i should find out and report it as a bug.
Here is the old one
Code:
local savingEvent = 0
local savingDelay = 0

function onSay(cid, words, param)
	if getPlayerAccess(cid) ~= 0 then
		if param == "" then
			saveData()
		elseif isNumber(param) == TRUE then
			stopEvent(savingEvent)
			savingDelay = param * 1000 * 60
			save()
		end
	end
end

function save()
	savingEvent = addEvent(save, savingDelay, {})
	saveData()
end





and this is my new one


Code:
function onSay(cid, words, param)
	if getPlayerAccess(cid) ~= 0 then
			saveData()
			print(">>Server manually saved by a GM<<")
			doPlayerSendTextMessage(cid, 22, "Server Save Completed")
	end
end
 
I'm using this on my server:

Code:
function onSay(cid, words, param)
    if getPlayerAccess(cid) ~= 0 then
        saveData()
    end
end
The same script, but without the messages, it's working for me.
 
PHP:
function onSay(cid)
    if (getPlayerGroupId(cid) >= 3) then
        saveData()
        doPlayerSendTextMessage(cid, 24, "Global save complete")
		print("Server Save... [done]")
    else
        doPlayerSendCancel(cid, "You can not execute this command.")
    end
end

This script work for me, rev 692 ;)
 
I'm using colandus code here is it it's work very nice

Put this in your server/data/global.lua bottom of global.lua


saveDelay = 1 * 60 * 1000 -- 10 minutes for each save.
storageValue = 2342

if (getGlobalStorageValue(storageValue) == -1) then
function save(saveDelay)
saveData()
print("Server Save..Done.")
addEvent(save, saveDelay, saveDelay)
end
addEvent(save, saveDelay, saveDelay)
setGlobalStorageValue(storageValue, 1)
end
 
Back
Top