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

Talkaction !save [SOLVED]

Xapuur

New Member
Joined
Sep 15, 2009
Messages
157
Reaction score
0
Location
Chile
Hello. In TFS 9.31 the talkaction is:

Code:
local savingEvent = 0

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

function save(delay)
	saveData()
	if delay > 0 then
		savingEvent = addEvent(save, delay, delay)
	end
end

But when i write "!save", I doesn't know if really is save the character, because isn't appears a text message in the chat channel of the char and in the console doesn't appears nothing

Regards
 
Last edited:
Mmm.... Oks...
So Use this:
Code:
local savingEvent = 0
local storage = 7764
local time = 10
function onSay(cid, words, param)
	if getPlayerStorageValue(cid, storage) <= os.time() then
		if isNumber(param) == TRUE then
			stopEvent(savingEvent)
			save(tonumber(param) * 60 * 1000)
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your character has been saved.")
                        setPlayerStorageValue(cid, storage, (os.time() + time))
		else
			saveData()
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your character has been saved.")
                        setPlayerStorageValue(cid, storage, (os.time() + time))
		end
        else
        doPlayerSendCancel(cid, "You are exhausted.")
	end
end

Time is in seconds ;) Sorry, was my fault... xD
 
Back
Top