Guest User

Untitled

a guest
Jan 21st, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.10 KB | None | 0 0
  1. function onUse(cid, item, fromPosition, itemEx, toPosition)
  2. local itemm =  {
  3. [7366] = {point = 25},
  4. [11113] = {point = 20},
  5. [11114] = {point = 20},
  6. [11257] = {point = 5},
  7. [2300] = {point = 25},
  8. [8925] = {point = 25},
  9. [8931] = {point = 25},
  10. [7735] = {point = 25},
  11. [2469] = {point = 15},
  12. [2664] = {point = 15},
  13. [8880] = {point = 15},
  14. [8903] = {point = 20},
  15. [2501] = {point = 15},
  16. [2503] = {point = 15},
  17. [2504] = {point = 15},
  18. [7896] = {point = 15},
  19. [7902] = {point = 15},
  20. [8866] = {point = 15},
  21. [2523] = {point = 20},
  22. [8474] = {point = 25}
  23. }
  24.  
  25.  
  26.  
  27. local item = getThingFromPos({x = 1001, y = 995, z = 8, stackpos = 1})
  28.  
  29.  
  30.     for k, v in pairs(itemm) do
  31.        if (item.uid ~= 0 and item.itemid == k) then
  32.             doRemoveItem(item.uid, 1)
  33.             db.query("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. v.point .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
  34.             doCreatureSay(cid, "You have got rid of "..getItemNameById(k).." and you have recievd again the "..v.point.." points.", TALKTYPE_ORANGE_1)
  35.         else
  36.           doPlayerSendCancel(cid,"Thin isnt a donated item")
  37.         end
  38.     end
  39.  
  40. end
Add Comment
Please, Sign In to add comment