Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

@leozincorsair acho que já sei, testa ai...

local vocs = {
[1] = {outfit = 400, effect = 35, cd = 1, vname = "Sakura", id = 1},
[2] = {outfit = 93, effect = 14, cd = 1, vname = "Sasuke Akatsuki", id = 502},
[3] = {outfit = 402, effect = 35, cd = 1, vname = "Naruto", id = 3},
}

local storage = 4444 -- storage para nao poder ficar usando toda hora..

function onSay(cid, words, param)

if (param == '') then
        local str = ""
        str = str .. "Vocations:\n\n"
            for a = 1, #vocs do
                str = str..""..vocs[a].vname.."\n"
            end
        doShowTextDialog(cid, 7416, str)
    return true
    end
    
if getPlayerStorageValue(cid, storage) >= 1 then
doPlayerSendTextMessage(cid,25,"Você já está usando uma outfit.")
return true
end     
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocation(cid) ~= vocs[x].id then
                doPlayerSendTextMessage(cid,25,"Sua vocação é " .. getPlayerVocationName(cid) ..".")  -- quando alguem tenta usar outfit q n é da sua vocação
            end    
        end        
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocation(cid) == vocs[x].id then
                addEvent(
                function()
                doRemoveCondition(cid, CONDITION_OUTFIT)
                setPlayerStorageValue(cid, storage, -1)
                end,
                vocs[x].cd * 60 * 1000) -- tempo em minutos para a outfit sair
                doSendMagicEffect(getThingPos(cid), vocs[x].effect) -- efeito que sai quando usa o comando
                doSetCreatureOutfit(cid, {lookType = vocs[x].outfit, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
                setPlayerStorageValue(cid, storage, 1)
                doPlayerSendTextMessage(cid,25,"Você ganhou temporariamente um outfit de ".. vocs[x].vname .."!")
            end    
        end            
return true
end

 

  • Respostas 23
  • Visualizações 1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @leozincorsair em vname = "Sasuke Akatsuki" você tem que colocar o nome certinho da vocação, caso contrário não vai ir.... aqui de todas a maneiras q mandei até agora, funcinou 100%   Tenta

Posted Images

Postado
  • Solução

@leozincorsair em vname = "Sasuke Akatsuki" você tem que colocar o nome certinho da vocação, caso contrário não vai ir.... aqui de todas a maneiras q mandei até agora, funcinou 100%

 

Tenta assim:

 

local vocs = {
[1] = {outfit = 400, effect = 35, cd = 1, vname = "Sakura"},
[2] = {outfit = 93, effect = 14, cd = 1, vname = "Sasuke Akatsuki"},
[3] = {outfit = 402, effect = 35, cd = 1, vname = "Naruto"},
}

local storage = 4444 -- storage para nao poder ficar usando toda hora..

function onSay(cid, words, param)

if (param == '') then
        local str = ""
        str = str .. "Vocations:\n\n"
            for a = 1, #vocs do
                str = str..""..vocs[a].vname.."\n"
            end
        doShowTextDialog(cid, 7416, str)
    return true
    end
    
if getPlayerStorageValue(cid, storage) >= 1 then
doPlayerSendTextMessage(cid,25,"Você já está usando uma outfit.")
return true
end     
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocationName(cid) ~= vocs[x].vname then
                doPlayerSendTextMessage(cid,25,"Sua vocação é " .. getPlayerVocationName(cid) ..".")  -- quando alguem tenta usar outfit q n é da sua vocação
            end    
        end        
    
for x = 1, #vocs do
            if string.find(string.lower(vocs[x].vname), string.lower(param)) and getPlayerVocationName(cid) == vocs[x].vname then
                addEvent(
                function()
                doRemoveCondition(cid, CONDITION_OUTFIT)
                setPlayerStorageValue(cid, storage, -1)
                end,
                vocs[x].cd * 60 * 1000) -- tempo em minutos para a outfit sair
                doSendMagicEffect(getThingPos(cid), vocs[x].effect) -- efeito que sai quando usa o comando
                doSetCreatureOutfit(cid, {lookType = vocs[x].outfit, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
                setPlayerStorageValue(cid, storage, 1)
                doPlayerSendTextMessage(cid,25,"Você ganhou temporariamente um outfit de ".. vocs[x].vname .."!")
            end    
        end            
return true
end

 

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