Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. function onUse(cid, item, frompos, item2, topos)
  2. if getItemAttribute(item.uid, "corpseowner") ~= cid then
  3. doPlayerSendCancel(cid, "You're not the owner.")
  4. return true
  5. end
  6. if isPremium(cid) then
  7. if getPlayerStorageValue(cid, 17009) < 1 then
  8. return false
  9. else
  10. local items = {}
  11. for x=0, (getContainerSize(item.uid)) do
  12. local itens = getContainerItem(item.uid, 0)
  13. if itens and itens.uid > 0 and itens.itemid ~= 0 then
  14. table.insert(items, {i=itens.itemid, q=itens.type})
  15. doRemoveItem(itens.uid)
  16. end
  17. end
  18. for y=1, #items do
  19. doPlayerAddItemStacking(cid, items[y].i, items[y].q)
  20. doPlayerSendTextMessage(cid, 20, "Looted "..items[y].q.."x "..getItemNameById(items[y].i)..".")
  21. end
  22. if #items > 0 then
  23. return true
  24. else
  25. return false
  26. end
  27. end
  28. else
  29. doPlayerSendTextMessage(cid, 20, "Você não é Vip para usar o autoLoot.")
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement