Ir para conteúdo

Featured Replies

Postado
  • Autor
  Em 01/11/2014 em 00:43, Orochi Elf disse:

 

Bom amigo, eu tentei desenvolver algo mais fácil de edição.

Eu fiz de um modo que você pode adicionar todas as outfits em um script só.

Basta ir editando a tabela de outfits, do mesmo modo que eu fiz

 

Não testei.

local outfits = {
    [4113] = {
        items = {
            [1] = {itemid = 2476, ammount = 5},
            [2] = {itemid = 2477, ammount = 5},
            [3] = {itemid = 2396, ammount = 5},
        },
        out = {
            [1] = 131, -- Female
            [2] = 139, -- Male
        },
        storageId = 10101,
    },
}

function onUse(cid, item)    
    local t = outfits[item.uid]
    
    if t then
        if getPlayerStorageValue(cid, t.storageId) <= 0 then
            for r = 1, #t.items do
                if(getPlayerItemCount(cid, t.items[r].itemid) < t.items[r].ammount) then
                
                    doPlayerSendTextMessage(cid, 22, "You need "..t.items[r].ammount.." "..getItemNameById(t.items[r].itemid))
                    return true
                end
                
                doPlayerRemoveItem(cid, t.items[r].itemid, t.items[r].ammount)
            end
            
            doPlayerAddOutfit(cid, t.out[getPlayerSex(cid) + 1], 3)
            doPlayerSendTextMessage(cid, 22, "You won a new outfit.")
            setPlayerStorageValue(cid, t.storageId, 1)
        end
    end
    return true
end

Nossa Orochi, belo script '-' me sinto humilhado! hehe

 

Não deu error na distro, porém algo não deu certo..

Eu puxo a alavanca, e além dela não virar, ela não me manda nenhuma mensagem que eu preciso dos items ou que ganhei o addon ..

Alguma coisa não funcionou, talvez a forma que coloquei.. olha como coloquei o script..pode ver se fiz algo errado ?

Sò editei os items,storage(seguindo padrão), e os addons ..

local outfits = {
    [4112] = {
        items = {
            [1] = {itemid = 2189, ammount = 1},
            [2] = {itemid = 2191, ammount = 1},
            [3] = {itemid = 2187, ammount = 1},
            [4] = {itemid = 2190, ammount = 1},
            [5] = {itemid = 2181, ammount = 1},
            [6] = {itemid = 2188, ammount = 1},
            [7] = {itemid = 8921, ammount = 1},
            [8] = {itemid = 2160, ammount = 25},
        },
        out = {
            [1] = 130, -- Female
            [2] = 138, -- Male
        },
        storageId = 100003,
    },
}

function onUse(cid, item)    
    local t = outfits[item.uid]
    
    if t then
        if getPlayerStorageValue(cid, t.storageId) <= 0 then
            for r = 1, #t.items do
                if(getPlayerItemCount(cid, t.items[r].itemid) < t.items[r].ammount) then
                
                    doPlayerSendTextMessage(cid, 22, "You need "..t.items[r].ammount.." "..getItemNameById(t.items[r].itemid))
                    return true
                end
                
                doPlayerRemoveItem(cid, t.items[r].itemid, t.items[r].ammount)
            end
            
            doPlayerAddOutfit(cid, t.out[getPlayerSex(cid) + 1], 3)
            doPlayerSendTextMessage(cid, 22, "You won a new outfit.")
            setPlayerStorageValue(cid, t.storageId, 1)
        end
    end
    return true
end
  • Respostas 17
  • Visualizações 692
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • O erro do distro é porque tava if getPlayerItemCount(cid, itens) = 1 then onde no caso deveria ser "==", pois o "=" serve pra definir algo, enquanto == é pra conferir se ta igual a x.

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