Advertisement
Mystical-Chams

Untitled

Apr 10th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 KB | None | 0 0
  1. function getPlayerVipPoints(cid)
  2.     local Info = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. "")
  3.         if Info:getID() ~= LUA_ERROR then
  4.         local Points= Info:getDataInt("premium_points")
  5.         Info:free()
  6.         return Points
  7.     end
  8.      return LUA_ERROR
  9. end
  10.  
  11. function doPlayerAddVipPoints(cid, points)
  12.     local dif = getPlayerVipPoints(cid) + points
  13.     if dif >=  then
  14.         db.Query("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
  15.         return TRUE
  16.     end
  17.     return FALSE
  18. end
  19.  
  20. function doPlayerRemoveVipPoints(cid, points)
  21.     local dif = getPlayerVipPoints(cid) - points
  22.     if dif >=  then
  23.         db.Query("UPDATE `accounts` SET `premium_points` = `premium_points` - " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
  24.         return TRUE
  25.     end
  26.     return FALSE
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement