Ir para conteúdo

Featured Replies

Resolvido por Adriano SwaTT

Ir para solução
  • 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

Primeiramente em creaturescripts.xml adicione a seguinte linha:

<event type="kill" name="anunciarmorte" event="script" value="anunciar_morte.lua"/>

Pós adicionar, crie um arquivo com o nome de anunciar_morte.lua e coloque dentro da pasta creaturescripts/scriptscom o seguinte conteúdo:

function onKill(cid, target, lastHit)

	if not isPlayer(target) or not isPlayer(cid) then
		return true
	end

	doBroadcastMessage(""..getCreatureName(target).."["..getPlayerLevel(target).."] acabou de ser humilhado pelo jogador "..getCreatureName(cid).."["..getPlayerLevel(cid).."].", MESSAGE_STATUS_CONSOLE_ORANGE)
    return true
end

Espero ter ajudado, até logo.

 

 

DarkXPoke - Servidor para Download

 

 

Postado

Tente assim:

 

#EDITADO
Em creaturescripts.xml adicione a tag:

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

E youdead.lua adicione o script abaixo:

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

    if isPlayer(cid) then
        print('morri')
        if not isPlayer(mostDamageKiller) and not isPlayer(getCreatureMaster(mostDamageKiller)) then
            print('NÃO para player')
            doBroadcastMessage("O jogador "..getCreatureName(cid).." ["..getPlayerLevel(cid).."] acaba de morrer para "..getCreatureName(mostDamageKiller)..".")
        else
            print('para player')
            doBroadcastMessage("O jogador "..getCreatureName(cid).." ["..getPlayerLevel(cid).."] acaba de morrer para "..getCreatureName(mostDamageKiller).." ["..getPlayerLevel(mostDamageKiller).."].")
        end
    end
    
return true
end

Agora em login.lua adicione a tag junto com as do gênero:

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
  • Autor

vou testar Adriano

 

Nao funcionou olha o erro ae

[09/03/2015 22:28:25] [Error - CreatureScript Interface] 
[09/03/2015 22:28:25] data/creaturescripts/scripts/youdead.lua:onDeath
[09/03/2015 22:28:25] Description: 
[09/03/2015 22:28:25] (luaGetCreatureMaster) Creature not found

[09/03/2015 22:28:25] [Error - CreatureScript Interface] 
[09/03/2015 22:28:25] data/creaturescripts/scripts/youdead.lua:onDeath
[09/03/2015 22:28:26] Description: 
[09/03/2015 22:28:26] (luaGetCreatureName) Creature not found

[09/03/2015 22:28:26] [Error - CreatureScript Interface] 
[09/03/2015 22:28:26] data/creaturescripts/scripts/youdead.lua:onDeath
[09/03/2015 22:28:26] Description: 
[09/03/2015 22:28:26] data/creaturescripts/scripts/youdead.lua:5: attempt to concatenate a boolean value
[09/03/2015 22:28:26] stack traceback:
[09/03/2015 22:28:26] 	data/creaturescripts/scripts/youdead.lua:5: in function <data/creaturescripts/scripts/youdead.lua:1>
[09/03/2015 22:28:26] Fio cheiroso has logged out.

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

 

 

 

 

 

 

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