Ir para conteúdo

Featured Replies

Postado

Galera bom dia! O que sera que tem de errado nesse script? Ele aparenta funcionar normalmente, qdo uso o item ele add o outfit qdo uso novamente ele remove certinho, mas apos ter usado 1 vez e tirado, eu nao consigo mais trocar por meus outfits de player ele fica enroscado naquele outfit que eu estava usando antes de usar o item pela primeira vez. sendo necessario eu logar e voltar pra poder voltar a mudar de fit normalmente...

function onUse(cid, item, fromPosition, itemEx, toPosition)
local outfit = {lookType = getPlayerStorageValue(cid, 3331), lookHead = getPlayerStorageValue(cid, 3332), lookAddons = getPlayerStorageValue(cid, 3333), lookLegs = getPlayerStorageValue(cid, 3334), lookBody = getPlayerStorageValue(cid, 3335), lookFeet = getPlayerStorageValue(cid, 3336)}
local storage = 42325
local areaPosition =
{
    {x=33380, y=31055, z=8, stackpos = 255}, --topleft
    {x=33400, y=31183, z=8, stackpos = 255}, --bottomright
    {x=33370, y=31093, z=8, stackpos = 255}, --topleft
    {x=33397, y=31117, z=8, stackpos = 255}, --bottomright
    {x=33349, y=31165, z=8, stackpos = 255}, --topleft
    {x=33383, y=31192, z=8, stackpos = 255}, --bottomright
    {x=33314, y=31058, z=8, stackpos = 255}, --topleft
    {x=33394, y=31090, z=8, stackpos = 255}, --bottomright
    {x=33327, y=31055, z=9, stackpos = 255}, --topleft
    {x=33387, y=31077, z=9, stackpos = 255}  --bottomright
}

    if isInRange(getCreaturePosition(cid), areaPosition[1], areaPosition[2]) or isInRange(getCreaturePosition(cid), areaPosition[3], areaPosition[4]) or isInRange(getCreaturePosition(cid), areaPosition[5], areaPosition[6]) or isInRange(getCreaturePosition(cid), areaPosition[7], areaPosition[8]) or isInRange(getCreaturePosition(cid), areaPosition[9], areaPosition[10]) then
        if getPlayerStorageValue(cid,storage) ~= 1 then
            setPlayerStorageValue(cid, 3331, getCreatureOutfit(cid).lookType)
            setPlayerStorageValue(cid, 3332, getCreatureOutfit(cid).lookHead)
            setPlayerStorageValue(cid, 3333, getCreatureOutfit(cid).lookAddons)
            setPlayerStorageValue(cid, 3334, getCreatureOutfit(cid).lookLegs)
            setPlayerStorageValue(cid, 3335, getCreatureOutfit(cid).lookBody)
            setPlayerStorageValue(cid, 3336, getCreatureOutfit(cid).lookFeet)
            doSetItemOutfit(cid, 12245, -1)
            setPlayerStorageValue(cid, storage, 1)
            doCreatureSay(cid, 'You remove its top and pull the crate over yourself. Inside it is stifling and you can barely see a thing when looking outward.', TALKTYPE_ORANGE_1)
            
        elseif getPlayerStorageValue(cid,storage) == 1 then
            doCreatureChangeOutfit(cid, outfit)
            setPlayerStorageValue(cid, storage, 0)
            doCreatureSay(cid, 'Somewhat relieved you catch a deep breath of fresh air as you remove your temporary disguise.', TALKTYPE_ORANGE_1)
        end    
    end
    return false
end

Postado
  • Autor

Desta vez ninguém pode me ajudar, e como eu estava quebrando a cabeça há 2 dias nesse script (pq sou ruim mesmo, pra muitos deve ser óbvio), vou compartilhar a solução com vocês, espero que ajude alguém.

Basta substituir:

doCreatureChangeOutfit(cid, outfit)

 

Por:

doRemoveCondition(cid, CONDITION_OUTFIT)

 

Resolveu 100% e fiz isso também em outros scripts que davam esse mesmo problema e resolveu em todos! Rep+ pra mim \o/

Podem fechar o tópico. Caso resolvido.

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo