MaXwEllDeN

Untitled

Apr 23rd, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. local cfg = {
  2.     points = 20, -- Points necessarios
  3.     gain = 15410, -- Item ID gained
  4.     amount = 1, -- Quantidade
  5. }
  6.  
  7. function onUse(cid, item, frompos, item2, topos)
  8.     local points = getAccountPoints(cid)
  9.     if points >= cfg.points then
  10.         doPlayerAddItem(cid, cfg.gain, cfg.amount)
  11.         doSendAnimatedText(getCreaturePosition(cid), "DONATE!", math.random(1, 255))
  12.         db.executeQuery("UPDATE `accounts` SET `premium_points` = '".. points - cfg.points .."' WHERE `name` ='".. getPlayerAccount(cid) .."'")
  13.     else
  14.         doPlayerSendTextMessage(cid, 20, "Você não tem points o suficiente, você tem "..getAccountPoints(cid).." points")
  15.     end
  16.    
  17.     return true
  18. end
Advertisement
Add Comment
Please, Sign In to add comment