JO

Scirp

Por joadson15, 01 de nov. de 2010 em Scripts

script
8
2.2k
joadson15J
01 de novembro de 2010 às 18:23

aqui o script

é pra ele fazer um item por talkaction

o player fala !darkwand e remove 3 tipos de items e da o novo item

eu consigo fazer com 1 item, mas com 3 da erro

function onSay(cid, words, param)
if doPlayerRemoveItem(cid,6500,500) then
if doPlayerRemoveItem(cid,5944,500) then
if doPlayerRemoveItem(cid,4848,1) then
doPlayerAddItem(cid,137,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
doCreatureSay(cid, "Você fez a Dark Wand com sucesso", TALKTYPE_ORANGE_1)
else
local str = "Voce Precisa de 500 Demonic Essences,500 Soul Orbs,1 Ice Wand!."
doPlayerPopupFYI(cid, str)
doPlayerSendCancel(cid, 'Voce Precisa de 500 Demonic Essences,500 Soul Orbs,1 Ice Wand!')
return FALSE
end
end

quem arrumar mim fala qual foi o erro!

Editado Novembro 1 por joadson15

SlicerS
01 de novembro de 2010 às 18:52

cara nao sei se vai da certo mas se nao me engano nessas linhas aki...

if doPlayerRemoveItem(cid,6500,500) then
if doPlayerRemoveItem(cid,5944,500) then
if doPlayerRemoveItem(cid,4848,1) then

 

era pra ta assim...

if doPlayerRemoveItem(cid,6500,500) = true then
if doPlayerRemoveItem(cid,5944,500) = true then
if doPlayerRemoveItem(cid,4848,1) = true then

 

e tb ta faltando um end ali no final do scritp... ficando assim...

 

function onSay(cid, words, param)
if doPlayerRemoveItem(cid,6500,500) = true then
if doPlayerRemoveItem(cid,5944,500) = true then
if doPlayerRemoveItem(cid,4848,1) = true then
doPlayerAddItem(cid,137,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
doCreatureSay(cid, "Você fez a Dark Wand com sucesso", TALKTYPE_ORANGE_1)
else
local str = "Voce Precisa de 500 Demonic Essences,500 Soul Orbs,1 Ice Wand!."
doPlayerPopupFYI(cid, str)
doPlayerSendCancel(cid, 'Voce Precisa de 500 Demonic Essences,500 Soul Orbs,1 Ice Wand!')
       return FALSE
end
end
end

 

posso estar errado ;D

Editado Novembro 1 por Slicer

joadson15J
01 de novembro de 2010 às 19:36

deu erro e nao pego!

SlicerS
01 de novembro de 2010 às 19:54

function onSay(cid, words, param, channel)
if doPlayerRemoveItem(cid,6500,500) and doPlayerRemoveItem(cid,5944,500) and doPlayerRemoveItem(cid,4848,1) then
doPlayerAddItem(cid,137,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
doCreatureSay(cid, "Você fez a Dark Wand com sucesso", TALKTYPE_ORANGE_1)
else
local str = "Voce Precisa de 500 Demonic Essences,500 Soul Orbs,1 Ice Wand!."
doPlayerPopupFYI(cid, str)
doPlayerSendCancel(cid, 'Voce Precisa de 500 Demonic Essences,500 Soul Orbs,1 Ice Wand!')
return FALSE
end
end

 

tenta isso... aki funciono

joadson15J
01 de novembro de 2010 às 20:22

pego, mas se o player tiver 100 de cada item e falar !darkwand ele remove os items

e se o player tiver 500 de cada ele remove e da os items!

joaohdJ
01 de novembro de 2010 às 23:16

Tente assim:

 

function onSay(cid, words, param, channel)

local c = {
     first_item = {id = 2120, quant = 1},
     second_item = {id = 2121, quant = 1},
     third_item = {id = 2122, quant = 1},
     reward = {id = 137, quant = 1}
}


     if getPlayerItemCount(cid, c.first_item.id) >=  c.first_item.quant then
        if getPlayerItemCount(cid, c.second_item.id) >=  c.second_item.quant then
           if getPlayerItemCount(cid, c.third_item.id) >=  c.third_item.quant then
              doPlayerRemoveItem(cid, c.first_item.id, c.first_item.quant)
              doPlayerRemoveItem(cid, c.second_item.id, c.second_item.quant)
              doPlayerRemoveItem(cid, c.third_item.id, c.third_item.quant)
              doPlayerAddItem(cid, c.reward.id, c.reward.quant)               
              doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
              doCreatureSay(cid, "Você fez a Dark Wand com sucesso", TALKTYPE_ORANGE_1)
           else
               doPlayerSendCancel(cid, "Voce precisa de ".. c.third_item.quant .. " " .. getItemNameById(c.third_item.id) .. " para fazer a wand.")
           end
        else
               doPlayerSendCancel(cid, "Voce precisa de ".. c.second_item.quant .. " " .. getItemNameById(c.second_item.id) .. " para fazer a wand.")
        end
     else
               doPlayerSendCancel(cid, "Voce precisa de ".. c.first_item.quant .. " " .. getItemNameById(c.first_item.id) .. " para fazer a wand.")   
     end
return true
end

 

 

Não se esqueça de configurar.

 

 

flw

joadson15J
02 de novembro de 2010 às 09:47

pronto agora pegou,

muito obrigado!!

joaohdJ
02 de novembro de 2010 às 11:03

Resolvido. Movido.

 

 

flw