Ir para conteúdo

Featured Replies

Postado

Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website).

Ex. TFS 1.3;

Base: OTX Malucoo Latest Gitlab 

 

 

Qual erro está surgindo/O que você procura?

Im trying to make a command (talkaction) that can´t be used while player is in combat,by monster,player or pzlocked(any combat)

I already tried with if(not(isPlayerPzLocked(cid))) but that only works if the player haz pz(by pk-skull-or field)

 

What lua configuration should i use in order to make it so cant be used while fighting

 

Thanks in advance!

Greetings from norway :D!

 

Você tem o código disponível? Se tiver publique-o aqui:

 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.

  • Respostas 5
  • Visualizações 646
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @selenia.global Just use the condition to see if it's in battle   if getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendTextMessage(cid, 13, "You can only use the command without

Postado
  • Autor

@Sttorm Perfect!!! Thanks a lot!!!! It works now as i wanted. 

Awesome!!! Thanks!

@Sttorm Also Could you help me with this ?

 

I Would like This setup:

 

-When Player cast command it says "You have been blessed by all of eight gods! and CONST_ME_HOLYAREA(and no other animation overwrite)

-When Player cast the command if he already has blessings it goes "You already have been blessed and CONST_ME_POFF(and no other animation overwrite)

-When Player cast the command If he was Condition_INFIGHT it says" You cant Buy Bless While you have battle time left and goes CONST_ME_DRAWBLOOD" (and no other animation overwrite)

 

With the This setup I get:

You have been blessed by all of eight gods! and CONST_ME_HOLYAREA + CONST_ME_POFF(I dont want the CONSTE_ME_POFF here,somehow in my setup it overwrites , it displays both at the same time)

"You already have been blessed and CONST_ME_POFF

You cant Buy Bless While you have battle time left And does CONST_ME_POFF" 

 

(Im not the author of this Script- I just Edited a little bit)

Thanks in advance :)

 

 

 

The setup:

 

function onSay(cid)

    local player = Player(cid)
    local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.7
    if(not(getCreatureCondition(cid, CONDITION_INFIGHT))) then
    if player:getBlessings() == 5 then
                player:sendCancelMessage("You already have been blessed!", cid)
            elseif player:removeMoney(totalBlessPrice) then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!")
                for b = 1, 5 do
                    player:addBlessing(b, 1)
                end
                player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
                
            else
                player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid)
            end
            player:getPosition():sendMagicEffect(CONST_ME_POFF)
    else
        player:sendCancelMessage("You can't buy bless while you have battle time left.")
    end
    player:getPosition():sendMagicEffect(CONST_ME_POFF)
end

Postado
function onSay(cid)

if creature:getCondition(cid, CONDITION_INFIGHT) then

player:sendTextMessage(cid, 13, "You can only use the command without being in battle")
  
return false
end

    local player = Player(cid)
    local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.7
    if(not(getCreatureCondition(cid, CONDITION_INFIGHT))) then
    if player:getBlessings() == 5 then
                player:sendCancelMessage("You already have been blessed!", cid)
            elseif player:removeMoney(totalBlessPrice) then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!")
                for b = 1, 5 do
                    player:addBlessing(b, 1)
                end
                player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
                
            else
                player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid)
            end
            player:getPosition():sendMagicEffect(CONST_ME_POFF)
    else
        player:sendCancelMessage("You can't buy bless while you have battle time left.")
    end
    player:getPosition():sendMagicEffect(CONST_ME_POFF)
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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo