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

problems with talkaction !save

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 it really save the character, because isn't appears a text message and in the console doesn't appears nothing

Regards
 
Try this one it may work!
LUA:
  local waittime = 30 --Default (30 seconds)
local storage = 5560

function onSay(cid, words, param, channel)
        if exhaustion.get(cid, storage) == FALSE then
                doPlayerSave(cid)
                exhaustion.set(cid, storage, waittime)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully saved your character.")
        else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. exhaustion.get(cid, storage) .. " seconds.")
        end    
        return TRUE
end
 
Back
Top