Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function doPlayerAddAdvancedFrag(cid, value)
- playerID = getPlayerGUID(cid)
- tx = db.getResult("SELECT `id`, `point` FROM `players` WHERE `id` = '"..playerID.."';")
- if(tx:getID() ~= -1)then
- info = tx:getDataInt("point")
- mod = string.find(tostring(value), "-")
- if mod then
- for w in string.gmatch(value, "%d+") do
- f = w
- end
- nvalue = (info - f)
- if nvalue <= 0 then
- nvalue = 0
- end
- else
- nvalue = (info + value)
- end
- db.executeQuery("UPDATE `players` SET `point` = ".. nvalue .." WHERE `player_id` = " .. playerID .. ";")
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment