BR
pedido

Auto Loot

Por BrunooMaciell, 30 de mar. de 2016 em Scripts

resolvido
script
7
2.5k
BrunooMaciellB
30 de março de 2016 às 01:29

Alguem consegui fazer o systema de auto loot onde vc clica no corpo morto do pokemon os itens que ele drop vai todos pra sua bag direto estilo PxG??

 

Rep++

DeadpoolD
30 de março de 2016 às 11:01

Amigo, vejo você criando esses tópicos de pedidos, sendo que todos esses sistemas já têm no fórum.. Não custa dá uma pesquisada, sem maldade, procure a sessão de downloads de script, e até mesmo em servidores você acha os sistemas, não custa baixar e retirar.

BrunooMaciellB
30 de março de 2016 às 17:19

cara os que tem aqui e auto loot pra adicionar item por comando nao ao clicar no corpo como eu quero!!!

DeadpoolD
30 de março de 2016 às 17:38
Melhor resposta
function onUse(cid, item, frompos, item2, topos)
if not isContainer(item.uid) then return false end
if getItemAttribute(item2.uid, "corpseowner") then
owner = getItemAttribute(item2.uid, "corpseowner")
if isCreature(owner) and isPlayer(owner) and cid ~= owner then
return true
end
end
if getPlayerStorageValue(cid, 83771) >= 1 then return false end
itens = getItensInContainer(item.uid)
itemType = getItensTypeInContainer(item.uid)
itemID = getItensIDInContainer(item.uid)
itamsID, itamsType = {}, {}

if #itens == 1 then
doPlayerPickItem(cid, itens[1], getPlayerItemCount(cid, itemID[1]), itemID[1], itemType[1])
return true
end
if #itens >= 2 then
for x = 1, #itens do
table.insert(itamsID, itemID[x])
table.insert(itamsType, itemType[x])
doRemoveItem(itens[x], itemType[x])
end
for x = 1, #itamsID do
addEvent(doPlayerPickItem2, 10 * x, cid, getPlayerItemCount(cid, itamsID[x]), itamsID[x], itamsType[x])
end
return true
end
return false
end

actions.xml

	<action itemid="IDCORPSES" event="script" value="autoLootCorpse.lua"/>

No some functions adicione isso no inicio:

function doPlayerPickItem(cid, item, count, itemid, itemtype)
	if not isPlayer(cid) then return false end
	if not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then return false end
	if item <= 0 then return false end
	if count > 0 then
		doPlayerRemoveItem(cid, itemid, count)
	end
	doPlayerAddItem(cid, itemid, count + itemtype)
	doRemoveItem(item, itemtype)
return true
end
function doPlayerPickItem2(cid, count, itemid, itemtype)
	if not isPlayer(cid) then return false end
	if not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then return false end
	if itemid <= 0 then return false end
	if count > 0 then
		doPlayerRemoveItem(cid, itemid, count)
	end
	doPlayerAddItem(cid, itemid, count + itemtype)
return true
end

Editado Março 30 por Overllord

DanihcvD
30 de março de 2016 às 20:31

@, problema resolvido?

BrunooMaciellB
31 de março de 2016 às 00:19

@, problema resolvido?

sim

DanihcvD
31 de março de 2016 às 15:04

Tópico movido para dúvidas / pedidos resolvidos.