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

Lua Error while adding VIP days to a player.

H4CK3R

'_'
Joined
Sep 24, 2011
Messages
592
Reaction score
32
Location
/root/sys/class/tty/
Greeting Otlanders,


Today I added kekox's system to my server but while trying to add/remove vip days to a player or so I'm getting error on console.
I'm using TFS 0.4 rev 3777


Here is the error while adding VIP days.
ZmIrxH1.jpg

Here is the error while removing VIP days.
tQ4-3E1.jpg

Here is my adddays script.
Code:
--- Script by Kekox.
function onSay(cid, words, param, channel)
        if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                return true
        end
 
        local t = string.explode(param, ",")
        t[1] = tonumber(t[1])
        if(not t[1]) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
                return true
        end
 
        local pid = cid
        if(t[2]) then
                pid = getPlayerByNameWildcard(t[2])
                if(not pid) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
                        return true
                end
        end
 
        if(t[1] > 365) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can only add max 365 vip days.")
                return true
        end
 
        sender = getPlayerByNameWildcard(cid)
 
    doAddVipDays(pid, t[1])
    doPlayerSendTextMessage(cid, "You have added ".. t[1] .." vip days to ".. t[2])
    doPlayerSendTextMessage(pid, sender .." just added you ".. t[1] .." vip days.")    
        return true
end
Here is my remove days script.
Code:
--- Script by Kekox fixed by Shawak.
function onSay(cid, words, param, channel)
        if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                return true
        end
 
        local t = string.explode(param, ",")
        t[1] = tonumber(t[1])
        if(not t[1]) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
                return true
        end
 
        local pid = cid
        if(t[2]) then
                pid = getPlayerByNameWildcard(t[2])
                if(not pid) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
                        return true
                end
        end
 
        if(t[1] > 365) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can only add max 365 vip days.")
                return true
        end
 
        sender = getPlayerByNameWildcard(cid)
 
    doRemoveVipDays(pid, t[1])
    doPlayerSendTextMessage(cid, "You have removed ".. t[1] .." vip days to ".. t[2])
    doPlayerSendTextMessage(pid, sender .." just removed you ".. t[1] .." vip days.")    
        return true
end

Anyhelp is welcome from anyone.
Thanks.


Regards,
H4CK3R
 
Last edited:
missing messagetype at doPlayerSendTextMessage function
Lua:
--- Script by Kekox.
function onSay(cid, words, param, channel)
        if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                return true
        end
 
        local t = string.explode(param, ",")
        t[1] = tonumber(t[1])
        if(not t[1]) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
                return true
        end
 
        local pid = cid
        if(t[2]) then
                pid = getPlayerByNameWildcard(t[2])
                if(not pid) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
                        return true
                end
        end
 
        if(t[1] > 365) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can only add max 365 vip days.")
                return true
        end
 
        sender = getPlayerName(cid)
 
    doAddVipDays(pid, t[1])
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have added ".. t[1] .." vip days to ".. t[2])
    doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, sender .." just added you ".. t[1] .." vip days.")    
        return true
end


Lua:
--- Script by Kekox fixed by Shawak.
function onSay(cid, words, param, channel)
        if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                return true
        end
 
        local t = string.explode(param, ",")
        t[1] = tonumber(t[1])
        if(not t[1]) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
                return true
        end
 
        local pid = cid
        if(t[2]) then
                pid = getPlayerByNameWildcard(t[2])
                if(not pid) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
                        return true
                end
        end
 
        if(t[1] > 365) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can only add max 365 vip days.")
                return true
        end
 
        sender = getPlayerName(cid)
 
    doRemoveVipDays(pid, t[1])
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,  "You have removed ".. t[1] .." vip days to ".. t[2])
    doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, sender .." just removed you ".. t[1] .." vip days.")    
        return true
end
 
Back
Top