Hello everyone, I got a problem with this function that returns the player total capacity but it returns me a nil value, can anyone help me?
Code:
function getPlayerCap(cid)
query = db.getResult("SELECT `cap` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")
if(query:getID() < 1) then
return nil
end
cap = query:getDataInt("cap")
query:free()
return cap
end