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

Lua doRemovePoints error

Selenotes

New Member
Joined
Dec 27, 2008
Messages
12
Reaction score
0
Code:
function doRemovePoints(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

That code is suposeed to remove you points from DB but when I use it with 1 prem points with a balance of 200 prem points I just get that my prem point balance is 1 prem points..
any help?:w00t:
 
LUA:
function doRemovePoints(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 = `premium_points` - " .. points .. " WHERE id=" .. getPlayerAccountId(cid) .. ";")
   Info:free()
   return 1
   end
 end
 
Back
Top