SA-MP Forums Archive
SendDeathMessage - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SendDeathMessage (/showthread.php?tid=272187)



SendDeathMessage - RatHack - 27.07.2011

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


Respuesta: SendDeathMessage - RatHack - 27.07.2011

Sorry for double posting

Nobody know it?


Re: SendDeathMessage - iPLEOMAX - 27.07.2011

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


Respuesta: SendDeathMessage - RatHack - 27.07.2011

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


Re: SendDeathMessage - Famalamalam - 27.07.2011

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


Respuesta: SendDeathMessage - RatHack - 27.07.2011

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
            }
        }
    }



Re: SendDeathMessage - Famalamalam - 27.07.2011

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


Re: SendDeathMessage - iPLEOMAX - 27.07.2011

Just fall from a high cliff and see.

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


Respuesta: SendDeathMessage - RatHack - 27.07.2011

But is correct my code?


Re: SendDeathMessage - iPLEOMAX - 27.07.2011

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;
}