Narzerus
Full-stack developer and old OT Developer
- Joined
- Oct 29, 2007
- Messages
- 202
- Reaction score
- 11
I get this error message randomly
Happens at random moments when someone uses my donator tokens.
The script that is causing trouble is the following
The error I suddenly get after executing the function a couple of times is
attempt to call field 'getDataInt' (a nil value)
Even though the value is by default 0, and if not, it's 1 (when player is a donator).
After the function shows this error, it starts happening each time the function is used.
Thanks!
Happens at random moments when someone uses my donator tokens.
The script that is causing trouble is the following
Code:
function isPlayerDonator(cid)
local result = db.getResult("SELECT `isdonator` FROM `accounts` WHERE `id` = '"..getPlayerAccountId(cid).."'")
local isdonator
if(result:getID() ~= -1) then
isdonator = result:getDataInt("isdonator")
end
if isdonator == 1 then
return true
else
return false
end
end
The error I suddenly get after executing the function a couple of times is
attempt to call field 'getDataInt' (a nil value)
Even though the value is by default 0, and if not, it's 1 (when player is a donator).
After the function shows this error, it starts happening each time the function is used.
Thanks!