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

Solved /save command don't work

simse

New Member
Joined
Jan 22, 2009
Messages
29
Reaction score
0
I don't know how to use the /save command in- game, I get this error in console when I write /save

[10:36:27.318] [Error - TalkAction Interface]
[10:36:27.320] data/talkactions/scripts/save.lua:eek:nSay
[10:36:27.321] Description:
[10:36:27.322] data/talkactions/scripts/save.lua:4: attempt to call global 'isNu
mber' (a nil value)
[10:36:27.323] stack traceback:
[10:36:27.325] data/talkactions/scripts/save.lua:4: in function <data/talkactio
ns/scripts/save.lua:3>

This is my save.lua file:
Code:
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)
    local tmp = tonumber(param)
    if(tmp ~= nil) then
        stopEvent(savingEvent)
        save(tmp * 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
 
Code:
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
 
Code:
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

Thank you! Rep+
 
Back
Top