I get this:
With this function:
The database has all it needs but I cant find an equivalent function that get the players accid
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/vip/vipdoor.lua:onUse
data/global.lua:745: attempt to call field 'getResult' (a nil value)
stack traceback:
[C]: in function 'getResult'
data/global.lua:745: in function 'getPlayerVipDays'
data/actions/scripts/vip/vipdoor.lua:2: in function <data/actions/script
s/vip/vipdoor.lua:1>
With this function:
Code:
function getPlayerVipDays(cid)
local Info = db.getResult("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local days= Info:getDataInt("vipdays")
Info:free()
return days
end
return LUA_ERROR
end
The database has all it needs but I cant find an equivalent function that get the players accid