Postado Março 14, 2022 3 anos Boa tarde galera do TK, estou aqui pra pedir a ajuda de voces para editar um escript de addon. nao manjo nada disso e ja tentei de varias formas e nao tive exito. quero que o script remova 2 itens ao inves de só um, no caso o item 9693 e 10503, alguem pode me ajudar ? AGRADEÇO A ATENÇAO Você tem o código disponível? Se tiver publique-o aqui: Spoiler function onSay(cid, words, param) local femaleOutfits = { ["addon"]={270} } local maleOutfits = { ["addon"]={273} } local msg = {"Digite o nome correto!", "Voce não possui um jester doll!.", "Bad param!", "Você recebeu seu addon!"} local param = string.lower(param) if (not isPremium(cid)) then doPlayerSendCancel(cid, "Você nao tem premium account.") return TRUE end if(getPlayerItemCount(cid, 9693) > 0) then if(param ~= "" and maleOutfits[param] and femaleOutfits[param]) then doPlayerRemoveItem(cid, 9693, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[4]) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) if(getPlayerSex(cid) == 0)then doPlayerAddOutfit(cid, femaleOutfits[param][1], 3) else doPlayerAddOutfit(cid, maleOutfits[param][1], 3) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[1]) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[2]) end end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
Postado Março 14, 2022 3 anos Declara o id do item, e usa a string no comando local sword = {9693, 10503} local count = 1 if item.itemid == sword then doPlayerRemoveItem(cid, sword, 1) Editado Março 14, 2022 3 anos por raulnapola123 (veja o histórico de edições)
Postado Março 14, 2022 3 anos Autor 17 minutos atrás, raulnapola123 disse: Declara o id do item, e usa a string no comando local sword = 1234 if item.itemid == sword then doPlayerRemoveItem(cid, sword, 1) como falei nao manjo nada, como ficaria no script pf ? Spoiler function onSay(cid, words, param) local femaleOutfits = { ["addon"]={270} } local maleOutfits = { ["addon"]={273} } local jester = {9693, 10503} local msg = {"Digite o nome correto!", "Voce não possui um jester doll!.", "Bad param!", "Você recebeu seu addon!"} local param = string.lower(param) if (not isPremium(cid)) then doPlayerSendCancel(cid, "Você nao tem premium account.") return TRUE end if(getPlayerItemCount(cid, jester) > 1) then if(param ~= "" and maleOutfits[param] and femaleOutfits[param]) then doPlayerRemoveItem(cid, jester, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[4]) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) if(getPlayerSex(cid) == 0)then doPlayerAddOutfit(cid, femaleOutfits[param][1], 3) else doPlayerAddOutfit(cid, maleOutfits[param][1], 3) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[1]) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[2]) end end tentei assim mas nao foi Editado Março 14, 2022 3 anos por carloos (veja o histórico de edições)
Postado Março 15, 2022 3 anos @carloos É proibido subir o tópico se não com a própria ferramenta para isso, usar mensagens para subir o tópico é proibido e pode levar a punições severas! Ver ai se vai funcionar, ainda não testei, se der algum erro posta ele em spoiler local itemsID = {9693, 10503} local maleOutfits = {["addon"] = {273}} local femaleOutfits = {["addon"] = {270}} local mensagem = {"Este addon não existe!", "Você precisa ter o "..getItemInfo(itemsID)[1].name.." e o "..getItemInfo(itemsID)[2].." para trocar no addon.", "Parâmetro incorreto!", "Você liberou um novo addon"} function onSay(cid, words, param) local param = string.Lower(param) if not isPremium(cid) then doPlayerSendCancel(cid, "Você não é Premium Account para usar esse sistema.") return true end for i = 1, table.maxn(itemsID) do if getPlayerItemCount(cid, itemsID[1]) == 0 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, mensagem[2]) return true else if param ~= "" and maleOutfits[param] and femaleOutfits[param] then doPlayerItemRemove(cid, itemsID, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, mensagem[4]) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, femaleOutfits[param][1], 3) else doPlayerAddOutfit(cid, maleOutfits[param][1], 3) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, mensagem[1]) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, mensagem[2]) end end end Meu Curso sobre Programação para OTServer Programando OTServer Peça o seu script! Entre agora mesmo no grupo Developing Conteúdos: Spoiler • Cidade [8.60] • Cave de Boss • Widget Gesior • Autoloot 100% • [Old Client] Como Hookar Dll • Configurando VPS Windowns • [Solução] Código Caracteres Especiais Discord: Belmont#7352 Não esqueça do REP+
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.