Esta vendo o doPlayerAddOutfit?
Ele é a função de adicionar um outfit ao character, 136 é o ID do outfit e o 1 é de 1º addon, mas pode-se usar também 2 para 2º e 3 para os 2.
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,34000) == -1 then
if getPlayerSex(cid) == 0 then
doPlayerAddOutfit(cid,136,1)
else
doPlayerAddOutfit(cid,128,1)
end
else
doPlayerSendTextMessage(cid,24,"Voce ja tem esse addon.")
end
end
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Vamos melhora-lo então:
Adicione isso no actions.xml:
<action uniqueid="7540" script="fonte.lua" />
Agora no fonte.lua coloque isso:
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,34000) == -1 then
if getPlayerSex(cid) == 0 then
doPlayerAddOutfit(cid,item.actionid,1)
else
doPlayerAddOutfit(cid,item.actionid - 8,1)
end
else
doPlayerSendTextMessage(cid,24,"Voce ja tem esse addon.")
end
end
Agora vá no baú e adicione o UID (uniquedid) 7540 e no AID (actionid) coloque o looktype Male (masculino), no exemplo do Tibiaa4e 136.
Caso uma mulher use, ela irá pegar o outfit feminino graças as modificações que eu fiz.
Use o arquivo outfits.xml para ver os looktypes.
;D