SendDeathMessage
#1

Hello!

When a person die, it doesn't show anything, only show when they get killed by a weapon..

I want, when a person die to appear that skull in the kill list
Reply
#2

Sorry for double posting

Nobody know it?
Reply
#3

pawn Код:
if(killerid == INVALID_PLAYER_ID || killerid == playerid) { SendDeathMessage(-1, playerid, reason); }
else SendDeathMessage(killerid, playerid, reason);
Guess it'll work.
Reply
#4

And there are too a icon that show that the player fall of, how to put that too?
Reply
#5

It's handled automatically by SA-MP internally which death message is shown according to the reasonid.
Reply
#6

I have this:

and i want to show all the death icons

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
   
    GivePlayerMoney(playerid, -2000);
    Killed[playerid] = killerid;
    SendDeathMessage(killerid,playerid,reason);
    if(killerid != INVALID_PLAYER_ID)
    {
        SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
        if(gTeam[killerid] != gTeam[playerid])
        {
            // Valid kill
            new str[128];
            SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
            GivePlayerMoney(killerid, 1000);
            if(IsPlayerJustice(playerid) && !IsPlayerJustice(killerid))
            {
                // stuff
            }
        }
    }
Reply
#7

pawn Код:
SendDeathMessage(killerid,playerid,reason);
That will send the signal to SA-MP to display the icons on the kill-list. Which icon shown is determined by the reasonid.

https://sampwiki.blast.hk/wiki/Weapons
Reply
#8

Just fall from a high cliff and see.

As Famalamalam said, Death reasons are handled by sa-mp itself.
Reply
#9

But is correct my code?
Reply
#10

Nope. Your code says this:
(If killer is not an invalid player, Send Death Message invalid player killed playerid with reason).

Corrected version:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{

    GivePlayerMoney(playerid, -2000);
    Killed[playerid] = killerid;
    if(killerid != INVALID_PLAYER_ID && killerid != playerid)
    {
        SendDeathMessage(killerid,playerid,reason);
        if(gTeam[killerid] != gTeam[playerid])
        {
            // Valid kill
            new str[128];
            SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
            GivePlayerMoney(killerid, 1000);
            if(IsPlayerJustice(playerid) && !IsPlayerJustice(killerid))
            {
                // stuff
            }
        }
    } else {
        SendDeathMessage(playerid,-1,reason);
    }
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)