Eu consegui Arrumar
Código para o 050-function.lua Correto:
function ChecarPontos(cid)
local Info = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local Points= Info:getDataInt("premium_points")
Info:free()
return Points
end
return LUA_ERROR
end
function AddPontos(cid, points)
local Info = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
db.executeQuery("UPDATE accounts SET premium_points = " .. points .. " WHERE id=" .. getPlayerAccountId(cid) .. ";")
Info:free()
return 1
end
end
function getPoints(cid)
local res = db.getResult('select `premium_points` from accounts where name = \''..getPlayerAccount(cid)..'\'')
if(res:getID() == -1) then
return 0
end
local ret = res:getDataInt("premium_points")
res:free()
return tonumber(ret)
end
function RemoverPontos(cid, points)
return db.executeQuery("UPDATE `accounts` SET `premium_points` = '".. getPoints(cid) - points .."' WHERE `name` ='"..getPlayerAccount(cid).."'")
end