Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getPlayerVipPoints(cid)
- local Info = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. "")
- if Info:getID() ~= LUA_ERROR then
- local Points= Info:getDataInt("premium_points")
- Info:free()
- return Points
- end
- return LUA_ERROR
- end
- function doPlayerAddVipPoints(cid, points)
- local dif = getPlayerVipPoints(cid) + points
- if dif >= then
- db.Query("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
- return TRUE
- end
- return FALSE
- end
- function doPlayerRemoveVipPoints(cid, points)
- local dif = getPlayerVipPoints(cid) - points
- if dif >= then
- db.Query("UPDATE `accounts` SET `premium_points` = `premium_points` - " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
- return TRUE
- end
- return FALSE
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement