Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onUse(cid, item, frompos, item2, topos)
- if getItemAttribute(item.uid, "corpseowner") ~= cid then
- doPlayerSendCancel(cid, "You're not the owner.")
- return true
- end
- if isPremium(cid) then
- if getPlayerStorageValue(cid, 17009) < 1 then
- return false
- else
- local items = {}
- for x=0, (getContainerSize(item.uid)) do
- local itens = getContainerItem(item.uid, 0)
- if itens and itens.uid > 0 and itens.itemid ~= 0 then
- table.insert(items, {i=itens.itemid, q=itens.type})
- doRemoveItem(itens.uid)
- end
- end
- for y=1, #items do
- doPlayerAddItemStacking(cid, items[y].i, items[y].q)
- doPlayerSendTextMessage(cid, 20, "Looted "..items[y].q.."x "..getItemNameById(items[y].i)..".")
- end
- if #items > 0 then
- return true
- else
- return false
- end
- end
- else
- doPlayerSendTextMessage(cid, 20, "Você não é Vip para usar o autoLoot.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement