johnnyflores961
New Member
- Joined
- Sep 26, 2012
- Messages
- 44
- Reaction score
- 1
When I say /save I get this error in my TFS CMD Lua Script Error: [TalkAction Interface] data/talkactions/scripts/save.luanSay
data/talkactions/scripts/save.lua:13:attempt to perform arithmetic on local 'param' (a string value) stack traceback: [C]: in function '__mul' data/talkactions/scripts/save.lua
This is my XML
<?xml version="1.0" encoding="UTF-8"?>
<talkactions>
<!-- commands -->
<talkaction words="/save" separator=" " group="3" acctype="1" script="save.lua" />
This is my .LUA
local savingEvent = 0
local function save(delay)
doSaveServer()
if(delay > 0) then
savingEvent = addEvent(save, delay, delay)
end
end
function onSay(cid, words, param, channel)
if(param ~= 0) then
stopEvent(savingEvent)
save(param * 60 * 1000)
elseif(param == '') then
doSaveServer(false)
else
local tid = getPlayerByNameWildcard(param)
if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
else
doPlayerSave(tid)
end
end
return true
end
Please if you can help me in any way with this issue I have been having that would be Amazing.
Also looking for help adding /commands
ALL FIXED!
data/talkactions/scripts/save.lua:13:attempt to perform arithmetic on local 'param' (a string value) stack traceback: [C]: in function '__mul' data/talkactions/scripts/save.lua
This is my XML
<?xml version="1.0" encoding="UTF-8"?>
<talkactions>
<!-- commands -->
<talkaction words="/save" separator=" " group="3" acctype="1" script="save.lua" />
This is my .LUA
local savingEvent = 0
local function save(delay)
doSaveServer()
if(delay > 0) then
savingEvent = addEvent(save, delay, delay)
end
end
function onSay(cid, words, param, channel)
if(param ~= 0) then
stopEvent(savingEvent)
save(param * 60 * 1000)
elseif(param == '') then
doSaveServer(false)
else
local tid = getPlayerByNameWildcard(param)
if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
else
doPlayerSave(tid)
end
end
return true
end
Please if you can help me in any way with this issue I have been having that would be Amazing.
Also looking for help adding /commands
ALL FIXED!
Last edited: