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

TFS 1.X+ TFS CANARY VIP SYSTEM PROBLEM

Zuber98

New Member
Joined
Apr 27, 2021
Messages
12
Reaction score
2
Hi, I have a problem as I will add to login

player:loadVipData()
player:updateVipTime()


I can't log in



scriptId: [/home/canary/data/scripts/creaturescripts/login.lua:callback]
timerEvent: []
callbackId:[]
function: []
error [data/lib/vip-system.lua:122: attempt to call field 'getDataInt' (a nil value)
stack traceback:
[C]: in function 'getDataInt'
data/lib/vip-system.lua:122: in function 'loadVipData'
/home/canary/data/scripts/creaturescripts/login.lua:36: in function </home/canary/data/scripts/creaturescripts/login.lua:3>]
 
Did you add it like this?

Lua:
function onLogin(player)
                player : loadVipData ()
                player : updateVipTime ()
                player : addAddonMount ()
    local serverName = configManager.getString(configKeys.SERVER_NAME)
 
Lua:
local login = CreatureEvent("PlayerLogin")

function login.onLogin(player)
    player : loadVipData ()
        player : updateVipTime ()
    local loginStr = "Welcome to " .. configManager.getString(configKeys.SERVER_NAME) .. "!"
    if player:getLastLoginSaved() <= 0 then
        loginStr = loginStr .. " Please choose your outfit."
        player:sendOutfitWindow()
    else
        if loginStr ~= "" then
            player:sendTextMessage(MESSAGE_LOGIN, loginStr)
        end

       player:sendTextMessage(MESSAGE_LOGIN, string.format("Your last visit in ".. SERVER_NAME ..": %s.", os.date("%d. %b %Y %X", player:getLastLoginSaved())))
    end

    -- Stamina
    nextUseStaminaTime[player.uid] = 0

    -- Promotion
    local vocation = player:getVocation()
    local promotion = vocation:getPromotion()
    if player:isPremium() then
        local value = player:getStorageValue(Storage.Promotion)
        if not promotion and value ~= 1 then
            player:setStorageValue(STORAGEVALUE_PROMOTION, 1)
        elseif value == 1 then
            player:setVocation(promotion)
        end
    elseif not promotion then
        player:setVocation(vocation:getDemotion())
    end

    -- Events
    player:registerEvent("PlayerDeath")
    player:registerEvent("DropLoot")

    if onExerciseTraining[player:getId()] then -- onLogin & onLogout
        stopEvent(onExerciseTraining[player:getId()].event)
        onExerciseTraining[player:getId()] = nil
        player:setTraining(false)
    end
    return true
end

login:register()


[2022-18-04 16:24:10.635] [error] Lua script error:
scriptInterface: [Scripts Interface]
scriptId: [/home/canary/data/scripts/creaturescripts/login.lua:callback]
timerEvent: []
callbackId:[]
function: []
error [data/lib/vip-system.lua:122: attempt to call field 'getDataInt' (a nil value)
stack traceback:
[C]: in function 'getDataInt'
data/lib/vip-system.lua:122: in function 'loadVipData'
/home/canary/data/scripts/creaturescripts/login.lua:4: in function </home/canary/data/scripts/creaturescripts/login.lua:3>]
 
Back
Top Bottom