Talkaction:
function onSay(cid, words, param)
if param == "" then
return doPlayerSendCancel(cid, "/autoloot on/off")
end
local value = param:lower() == "on" and 1 or param:lower() == "off" and -1 or false
if not value then
return doPlayerSendCancel(cid, "/autoloot on/off")
elseif getPlayerStorageValue(cid, 4919) == value then
return doPlayerSendCancel(cid, "Your autoloot is already "..param..".")
end
setPlayerStorageValue(cid, 4919, value)
doPlayerSendTextMessage(cid, 27, "Your autoloot is now "..param..".")
return true
end
Tag da action:
<action actionid="9282" event="script" value="Autoloot.lua"/>
Novo código da action:
--local toloot = {11441, 11441, 11443, 11444, 11445, 11446, 11447, 11448, 11449,11450, 11451, 11452, 11453, 11454, 12618, 12232, 12244} -- PREFERENCIAL - SE QUISER APENAS COM ALGUNS ITENS
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 getPlayerStorageValue(cid, 4919) < 1 then
return false
else
local items = {}
for x=0, (getContainerSize(item.uid)) do
local itens = getContainerItem(item.uid, x)
--if isInArray(toloot, itens.itemid) then
table.insert(items, {i=itens.itemid, q=itens.type})
doRemoveItem(itens.uid)
--break
--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
end
--[[
AUTO LOOT BY GABRIEL SALES
SE QUISER ATIVAR O AUTOLOOT APENAS PARA ALGUNS ITENS, ADICIONE OS IDS NA TABELA toloot E TIRE OS COMENTÁRIOS(--).
--]]
Se a base de seu servidor for PDA:
Em data/creaturescripts/scripts, pokeexp.lua:
Abaixo de:
function onDeath(cid, corpse, deathList)
coloque:
doItemSetAttribute(corpse.uid, "aid", 9282)
Se a base do seu servidor não for PDA, avise.
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.