• 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 [SQLite] -=[TFS]=- 0.4 8.60 Systemvip Problem on /checkvip of player

samuel157

/root
Joined
Mar 19, 2010
Messages
447
Solutions
3
Reaction score
49
Location
São Paulo, Brazil
GitHub
Samuel10M
Lua:
elseif(words == "/checkvip") then
if getPlayerAccess(cid) == 5 then
if not param then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
end

local player = getPlayerByName(param)
if not isPlayer(player) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player "..player.." not found.")
end

local timenow = os.time()

local quantity = math.floor((getPlayerStorageValue(player, 13545) - timenow)/(24 * 60 * 60))
doPlayerPopupFYI(cid, "O jogador tem ".. (quantity < 0 and 0 or quantity) .." dias de VIP no character.")
return TRUE
end

Lua:
[19/09/2023 23:23:03] [Error - TalkAction Interface]
[19/09/2023 23:23:03] data/talkactions/scripts/systemvip.lua:onSay
[19/09/2023 23:23:03] Description:
[19/09/2023 23:23:03] data/talkactions/scripts/systemvip.lua:47: attempt to concatenate local 'player' (a nil value)
[19/09/2023 23:23:03] stack traceback:
[19/09/2023 23:23:03]     data/talkactions/scripts/systemvip.lua:47: in function <data/talkactions/scripts/systemvip.lua:3>
 
Last edited:
This script even the player with VIP says it's over, if you can help me I'd appreciate it

Lua:
function onLogin(cid)
    local vipStorage = getPlayerStorageValue(cid, 13545)
    
    if vipStorage > 0 then
        if vipStorage - os.time() <= 0 then
            setPlayerStorageValue(cid, 13545, -1)
            doPlayerPopupFYI(cid, "Sua VIP Account acabou.")
            if string.find(tostring(getCreatureName(cid)), "%[VIP%]") then
                addEvent(EddyHavoc, 3 * 1000, cid)
            end
        else
            local pos = {x = 154, y = 51, z = 7}
            doTeleportThing(cid, pos)
            doPlayerPopupFYI(cid, "Sua VIP Account acabou.")
            setPlayerStorageValue(cid, 13545, -1)
            if string.find(tostring(getCreatureName(cid)), "%[VIP%]") then
                addEvent(EddyHavoc, 3 * 1000, cid)
            end
        end
    end
    return true
end
 
Last edited:
Back
Top