Postado Abril 10, 2014 11 anos Autor seria assim, estou usando o outfit 128 (citizen male), eu coloco o item 2195 (BOH) no inventário e aparece no personagem o addon 1 e quando removo o item 2195 o addon some, entendeu?
Postado Abril 10, 2014 11 anos Solução Eu fiz aqui, está funcionando, porém, estou tentando resolver um possível bug. Que seria no caso do player por o item, remover e continuar com o addon. Bom, vou postar o script: Isto em movements.xml: <movevent type="Equip" itemid="2195" slot="feet" event="script" value="addon.lua"/> <movevent type="DeEquip" itemid="2195" slot="feet" event="script" value="addon.lua"/> . Este no arquivo "addon.lua": local male, female = 128, 136 function onEquip(cid, item, slot) local addon = {lookType = 128, lookHead = getPlayerStorageValue(cid, 3331), lookBody = getPlayerStorageValue(cid, 3332), lookLegs = getPlayerStorageValue(cid, 3333), lookFeet = getPlayerStorageValue(cid, 3334), lookTypeEx = 0, lookAddons = 1} local addon2 = {lookType = 136, lookHead = getPlayerStorageValue(cid, 3341), lookBody = getPlayerStorageValue(cid, 3342), lookLegs = getPlayerStorageValue(cid, 3343), lookFeet = getPlayerStorageValue(cid, 3344), lookTypeEx = 0, lookAddons = 1} local get = getCreatureOutfit(cid) local check = getCreatureOutfit(cid) local sex = getPlayerSex(cid) if check.lookType == male and sex == 1 then -- Male setPlayerStorageValue(cid, 3331, get.lookHead) setPlayerStorageValue(cid, 3332, get.lookBody) setPlayerStorageValue(cid, 3333, get.lookLegs) setPlayerStorageValue(cid, 3334, get.lookFeet) doPlayerAddOutfit(cid, male, 1) doPlayerSendTextMessage(cid, 20, "Addon adicionado com sucesso.") doCreatureChangeOutfit(cid, addon) elseif check.lookType == female and sex == 0 then -- Female setPlayerStorageValue(cid, 3341, get.lookHead) setPlayerStorageValue(cid, 3342, get.lookBody) setPlayerStorageValue(cid, 3343, get.lookLegs) setPlayerStorageValue(cid, 3344, get.lookFeet) doPlayerAddOutfit(cid, female, 1) doPlayerSendTextMessage(cid, 20, "Addon adicionado com sucesso.") doCreatureChangeOutfit(cid, addon2) elseif check.lookType ~= male and check.lookType ~= female then doPlayerSendTextMessage(cid, 23, "Voce precisa estar usando Citizen outfit para ativar o addon Premium.") return true end return true end function onDeEquip(cid, item, slot) local remove_male = {lookType = 128, lookHead = getPlayerStorageValue(cid, 3331), lookBody = getPlayerStorageValue(cid, 3332), lookLegs = getPlayerStorageValue(cid, 3333), lookFeet = getPlayerStorageValue(cid, 3334), lookTypeEx = 0, lookAddons = 0} local remove_female = {lookType = 136, lookHead = getPlayerStorageValue(cid, 3341), lookBody = getPlayerStorageValue(cid, 3342), lookLegs = getPlayerStorageValue(cid, 3343), lookFeet = getPlayerStorageValue(cid, 3344), lookTypeEx = 0, lookAddons = 0} if getPlayerSex(cid) == 1 and getCreatureOutfit(cid).lookType == male then doPlayerRemoveOutfit(cid, male, 1) doPlayerSendTextMessage(cid, 20, "Addon removido com sucesso.") doCreatureChangeOutfit(cid, remove_male) elseif getPlayerSex(cid) == 0 and getCreatureOutfit(cid).lookType == female then doPlayerRemoveOutfit(cid, female, 1) doPlayerSendTextMessage(cid, 20, "Addon removido com sucesso.") doCreatureChangeOutfit(cid, remove_female) elseif getCreatureOutfit(cid).lookType ~= female and getCreatureOutfit(cid).lookType ~= male then doPlayerSendTextMessage(cid, 23, "Lembre-se, para ativar o addon Premium, precisa estar usando o outfit Citizen.") return true end return true end Vou tentar arrumar este detalhe que lhe falei, se conseguir edito aqui. @@- ATUALIZADO NOVAMENTE - EDITADO às 12:21h O script está com um bug, talvez alguém consiga resolver.. Mas está funcionando da seguinte maneira: Checa se o player é male ou female para adicionar o respectivo addon. Checa a cor do outfit que o player está usando, para assim adicionar o addon e continuar com as cores personalizadas do player. Checa se o player está usando a outfit Citizen, se não estiver, não adiciona o addon. Quando o player remove o item, ele continua do mesmo jeito que era antes, inclusive as cores. Bug: O único bug, é no player female, quando remove o item ela não está ficando com as cores personalizadas de antes. Quando coloca o item, ela ganha o addon normalmente, continuando com as cores, mas quando remove que fica toda de roupa branca. Fora isso, está funcionando perfeitamente. Faça bom aproveito. Boa sorte. Editado Abril 10, 2014 11 anos por Adriano SwaTT (veja o histórico de edições)
Postado Abril 10, 2014 11 anos Autor cara, em que servidor você testou? pois no meu tfs 0.4 nada aconteceu
Postado Abril 10, 2014 11 anos Testo no meu mesmo, "The Lost Server, version 1.0 (Scorpion)" mas todo editado. Não aconteceu nada, nada nadA? Nem a frase?
Postado Abril 10, 2014 11 anos Autor nada, testei com player normal, com god, com boh criada por god e boh loot de ferumbras
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.