Ir para conteúdo
Banner com Efeitos

Featured Replies

Resolvido por Wakon

Ir para solução
  • Respostas 8
  • Visualizações 897
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Aaa esqueci, fiz um negócio pra testar e esqueci de tirar. Mude isso: if getPlayerPremiumDays(cid) >= 0 thenPara isso:if getPlayerPremiumDays(cid) > 0 then Irá funcionar do jeito que você qu

  • function onSay(cid, words, param) local vocs = { [1] = 5, -- master sorcerer [2] = 6, -- elder druid [3] = 7, -- royal paladin [4] = 8, -- elite knight

Postado
function onSay(cid, words, param) 

local newvoc = getPromotedVocation(getPlayerVocation(cid))  
local price = 20000
             
    if getPlayerPremiumDays(cid) > 0 then
        if getPlayerMoney(cid) >= price then
            doPlayerSetVocation(cid,newvoc)
            doPlayerRemoveMoney(cid, price)
            doPlayerSendCancel(cid, "Parabens voce foi promovido.")
        else
            doPlayerSendCancel(cid, "Voce nao tem dinheiro suficiente.")
            doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
        end
    else
        doPlayerSendCancel(cid, "Voce precisa ser premium para usar esse comando.")
        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
    end
    return true
end

           
<talkaction words="!buypromotion" event="script" value="seuarquivo.lua"/>


Tenta isso.
 

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

Postado
  • Autor
function onSay(cid, words, param) 

local newvoc = getPromotedVocation(getPlayerVocation(cid))  
local price = 20000
             
    if getPlayerPremiumDays(cid) > 0 then
        if getPlayerMoney(cid) >= price then
            doPlayerSetVocation(cid,newvoc)
            doPlayerRemoveMoney(cid, price)
            doPlayerSendCancel(cid, "Parabens voce foi promovido.")
        else
            doPlayerSendCancel(cid, "Voce nao tem dinheiro suficiente.")
            doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
        end
    else
        doPlayerSendCancel(cid, "Voce precisa ser premium para usar esse comando.")
        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
    end
    return true
end

           
<talkaction words="!buypromotion" event="script" value="seuarquivo.lua"/>


Tenta isso.


 

deu esse erro:

[17/10/2015  00:17:47] Lua Script Error: [TalkAction Interface] 
[17/10/2015  00:17:47] data/talkactions/scripts/promotion.lua:onSay

[17/10/2015  00:17:47] data/talkactions/scripts/promotion.lua:14: attempt to call global 'getPlayerPromotionLevel' (a nil value)
[17/10/2015  00:17:47] stack traceback:
[17/10/2015  00:17:47]     data/talkactions/scripts/promotion.lua:14: in function <data/talkactions/scripts/promotion.lua:8>

Postado

deu esse erro:

[17/10/2015  00:17:47] Lua Script Error: [TalkAction Interface] 
[17/10/2015  00:17:47] data/talkactions/scripts/promotion.lua:onSay

[17/10/2015  00:17:47] data/talkactions/scripts/promotion.lua:14: attempt to call global 'getPlayerPromotionLevel' (a nil value)
[17/10/2015  00:17:47] stack traceback:
[17/10/2015  00:17:47]     data/talkactions/scripts/promotion.lua:14: in function <data/talkactions/scripts/promotion.lua:8>


Humm, você não tem essa função, "vou arrumei".

 

function onSay(cid, words, param) 

local vocs = { [1] = 5, -- master sorcerer

               [2] = 6, -- elder druid

               [3] = 7, -- royal paladin

               [4] = 8, -- elite knight

               }

local newvoc = vocs[getPlayerVocation(cid)]
local price = 20000
             
    if getPlayerPremiumDays(cid) >= 0 then

        if getPlayerMoney(cid) >= price then

            if vocs[getPlayerVocation(cid)] then

                doPlayerSetVocation(cid,newvoc)
                doPlayerRemoveMoney(cid, price)
                doPlayerSendCancel(cid, "Parabens voce foi promovido.")
            else

                doPlayerSendCancel(cid, "Voce nao pode ser promovido.")
                doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
            end   

        else

            doPlayerSendCancel(cid, "Voce nao tem dinheiro suficiente.")
            doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
        end

    else

        doPlayerSendCancel(cid, "Voce precisa ser premium para usar esse comando.")
        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
    end

    return true

end

 



 

Editado por Caronte
I'm sexy and i know it. (veja o histórico de edições)

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

Postado
  • Autor

Humm, você não tem essa função, "vou arrumei".

 

function onSay(cid, words, param) 

local vocs = { [1] = 5, -- master sorcerer

               [2] = 6, -- elder druid

               [3] = 7, -- royal paladin

               [4] = 8, -- elite knight

               }

local newvoc = vocs[getPlayerVocation(cid)]
local price = 20000
             
    if getPlayerPremiumDays(cid) >= 0 then

        if getPlayerMoney(cid) >= price then

            if vocs[getPlayerVocation(cid)] then

                doPlayerSetVocation(cid,newvoc)
                doPlayerRemoveMoney(cid, price)
                doPlayerSendCancel(cid, "Parabens voce foi promovido.")
            else

                doPlayerSendCancel(cid, "Voce nao pode ser promovido.")
                doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
            end   

        else

            doPlayerSendCancel(cid, "Voce nao tem dinheiro suficiente.")
            doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
        end

    else

        doPlayerSendCancel(cid, "Voce precisa ser premium para usar esse comando.")
        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
    end

    return true

end

 



 

obrigado por arrumar, "funcionou" mas Não "funcionou"
porque até freeaccounts estão conseguindo se promover.

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.7k

Informação Importante

Confirmação de Termo