OK

Use Item Ganha Addon

Por oktober15, 27 de abr. de 2012 em Scripts

item addon
script
16
2.3k
oktober15O
27 de abril de 2012 às 22:14

Queria um script que ao player der use em tal item, ganhase tal addon, mais nao o addon completo

+rep

AnneMottaA
27 de abril de 2012 às 22:34

edited ------------------

 

meu script tava extremamente errado, um tempo sem mexer com isso por isso retirei. sorry.

Editado Abril 28 por AnneMotta

oktober15O
28 de abril de 2012 às 00:49

desculpe mais nao funfo ;s

 

fiz esse:

function onUse(cid, item, fromPosition, itemEx, toPosition)

if (getPlayerStorageValue(cid, 4766) == EMPTY_STORAGE) then

getPlayerItemCount(cid, 13926, 1)

doCreatureSay(cid, "First afflited addon!", TALKTYPE_ORANGE_1)

doPlayerAddOutfit(cid, 430, 1)

doPlayerAddOutfit(cid, 431, 1)

doPlayerRemoveItem(cid, 13926, 1)

setPlayerStorageValue(cid, 4766, 1)

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)

else

doPlayerSendTextMessage(cid,22,"Voce ja tem este addon.")

end

return true

end

só que se o item tiver no chao, o player ganha o addon e o item nao some, só some se estiver na bp

alguem ajuda com esse problema.. vlw e +rep

VildenV
28 de abril de 2012 às 01:03

Nen sei se essa função funciona...

 

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local storage = 4766

local item = 13926

 

if getPlayerStorageValue(cid, storage) == -1 and getPlayerItemCount(cid, item, 1) then

doCreatureSay(cid, "First afflited addon!", TALKTYPE_ORANGE_1)

doRemoveItem(cid,item)

doPlayerAddOutfit(cid, 430, 1)

doPlayerAddOutfit(cid, 431, 1)

else

doPlayerSendTextMessage(cid,22,"Voce ja tem este addon.")

end

end

oktober15O
28 de abril de 2012 às 01:20

Nen sei se essa função funciona...

 

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local storage = 4766

local item = 13926

 

if getPlayerStorageValue(cid, storage) == -1 and getPlayerItemCount(cid, item, 1) then

doCreatureSay(cid, "First afflited addon!", TALKTYPE_ORANGE_1)

doRemoveItem(cid,item)

doPlayerAddOutfit(cid, 430, 1)

doPlayerAddOutfit(cid, 431, 1)

else

doPlayerSendTextMessage(cid,22,"Voce ja tem este addon.")

end

end

nao funfo tbm, agr nem da bp ele some .-.

VildenV
28 de abril de 2012 às 01:41
function onUse(cid, item, fromPosition, itemEx, toPosition)

local storage = 4766

local item = 13926

 

if getPlayerStorageValue(cid, storage) == -1 and getPlayerItemCount(cid, item, 1) then

doCreatureSay(cid, "First afflited addon!", TALKTYPE_ORANGE_1)

doPlayerRemoveItem(cid, item, 1)

doPlayerAddOutfit(cid, 430, 1)

doPlayerAddOutfit(cid, 431, 1)

setPlayerStorageValue(cid,storage,1)

else

doPlayerSendTextMessage(cid,22,"Voce ja tem este addon ou não tem o item necessário.")

end

end

Editado Abril 28 por Vilden

kevin2010K
28 de abril de 2012 às 01:41

como coloco para usar varias vez

VildenV
28 de abril de 2012 às 01:46

Nessa parte:

if getPlayerStorageValue(cid, storage) == -1 and getPlayerItemCount(cid, item, 1) then

 

Modifique:

if getPlayerItemCount(cid, item, 1) then

__________________________

Dúvida sanada, tópico movido.

Agradecer não mata.

Editado Abril 28 por Vilden

kevin2010K
28 de abril de 2012 às 10:09

Nessa parte:

if getPlayerStorageValue(cid, storage) == -1 and getPlayerItemCount(cid, item, 1) then

 

Modifique:

if getPlayerItemCount(cid, item, 1) then

__________________________

Dúvida sanada, tópico movido.

Agradecer não mata.

na hora que vc me passo negocio a luz caiu mals muito obrigado +rep so amanha

Editado Abril 28 por kevin2010

oktober15O
28 de abril de 2012 às 10:43

ainda continua o bug ._. , ele da o addon e só é possivel usa 1x, tudo certo até ai, mais se o item tiver no chao, ele da o addon e nao some, só some se estiver na bp

VildenV
28 de abril de 2012 às 12:44

Amigo claro que não continua o bug.. você fez algo errado.. pra começa ele só vai usa

o item se estiver na bp.. se estiver no chão, vai fala que ele não tem o item..

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local storage = 4766 -- storage pra usa so 1x

local item = 13926 --id do item q vai clica

 

if getPlayerStorageValue(cid, storage) == -1 and getPlayerItemCount(cid, item, 1) then

doCreatureSay(cid, "First afflited addon!", TALKTYPE_ORANGE_1)

doPlayerRemoveItem(cid, item, 1)

doPlayerAddOutfit(cid, 430, 1)

doPlayerAddOutfit(cid, 431, 1)

setPlayerStorageValue(cid,storage,1)

else

doPlayerSendTextMessage(cid,22,"Voce ja tem este addon ou não tem o item necessário.")

end

end

Editado Abril 28 por Vilden

oktober15O
28 de abril de 2012 às 18:19

continua sim, refiz, conferi tudo que vc mando, e ainda continua, se der use com o item no chao ele nao some e da o addon.

VildenV
29 de abril de 2012 às 10:22

function onUse(cid, item, fromPosition, itemEx, toPosition)

local storage = 4766 -- storage pra usa so 1x

local item = 13926 --id do item q vai clica

 

if getPlayerStorageValue(cid, storage) == -1 and doPlayerRemoveItem(cid, item, 1) then

doCreatureSay(cid, "First afflited addon!", TALKTYPE_ORANGE_1)

doPlayerAddOutfit(cid, 430, 1)

doPlayerAddOutfit(cid, 431, 1)

setPlayerStorageValue(cid,storage,1)

else

doPlayerSendTextMessage(cid,22,"Voce ja tem este addon ou não tem o item necessário.")

end

end

oktober15O
29 de abril de 2012 às 11:46

Agora sim hehe, tudo certinho, vlw msm, e 2+rep pra vc

VildenV
29 de abril de 2012 às 11:58

Movido.