Ir para conteúdo

Featured Replies

  • Respostas 15
  • Visualizações 1.3k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Adriano SwaTT
    Adriano SwaTT

    Certo, agora testei e funcionou perfeitamente. function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)     if isPlayer(cid) then         if not isPlayer(lastHitKiller[1]) and not isPlayer(get

  • function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)     if isPlayer(cid) then         if not isPlayer(lastHitKiller[1]) and not isPlayer(getCreatureMaster(lastHitKiller[1])) then          

Postado
  • Solução

Certo, agora testei e funcionou perfeitamente.

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

    if isPlayer(cid) then
        if not isPlayer(lastHitKiller[1]) and not isPlayer(getCreatureMaster(lastHitKiller[1])) then
            doBroadcastMessage("O jogador "..getCreatureName(cid).." [level: "..getPlayerLevel(cid).."] acaba de morrer para "..getCreatureName(lastHitKiller[1])..".", MESSAGE_STATUS_CONSOLE_ORANGE)
        end
    end
return true
end

Registre em creaturescripts.xml a tag abaixo:

<event type="preparedeath" name="YouDead" event="script" value="youdead.lua"/>

E em login.lua a tag:

registerCreatureEvent(cid, "YouDead")

Boa sorte.

Editado por Adriano SwaTT (veja o histórico de edições)

Gosta do meu trabalho?

Curta e siga a página do meu projeto de 2016 e 2017 (Lab Z Games) que trará vários servidores OTServs.

 

Atenciosamente,
Adriano Swatt'

 

Para ver meus tutoriais acesse meu perfil.

 

cbCyOSZ.png

Postado

Funcionou mas n tem como por no default?

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)


    if isPlayer(cid) then
        if not isPlayer(lastHitKiller[1]) and not isPlayer(getCreatureMaster(lastHitKiller[1])) then
            doBroadcastMessage("O jogador "..getCreatureName(cid).." [level: "..getPlayerLevel(cid).."] acaba de morrer para "..getCreatureName(lastHitKiller[1])..".", MESSAGE_STATUS_CONSOLE_ORANGE)
        else
            doBroadcastMessage("O jogador "..getCreatureName(cid).." [level: "..getPlayerLevel(cid).."] acaba de morrer para "..getCreatureName(lastHitKiller[1]).." [level: "..getPlayerLevel(lastHitKiller[1]).."].", MESSAGE_STATUS_CONSOLE_ORANGE)
        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.7k

Informação Importante

Confirmação de Termo