SendDeathMessage

From SA-MP Wiki

Jump to: navigation, search

The 5 most recent kills are shown on the right side of players' screens. Pressing F9 will hide/show the list.
The 5 most recent kills are shown on the right side of players' screens. Pressing F9 will hide/show the list.

Description:

Adds a death to the 'killfeed' on the right-hand side of the screen for all players.


Parameters:
(killer, playerid, weapon)
killerThe ID of the killer (can be INVALID_PLAYER_ID).
playeridThe ID of the player that died.
weaponThe reason (not always a weapon) for the victim's death. Special icons can also be used (ICON_CONNECT and ICON_DISCONNECT).


Return Values:

This function always returns 1, even if the function fails to execute. The function fails to execute (no death message shown) if 'playerid' is invalid. If 'reason' is invalid, a generic skull-and-crossbones icon is shown. 'killerid' being invalid (INVALID_PLAYER_ID) is valid.


Example Usage:

public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    return 1;
}
Tips

Image:Light_bulb_icon.png

  • Death messages can be cleared by using a valid player ID for 'playerid' that is not connected.
  • To show a death message for just a single player, use SendDeathMessageToPlayer.
  • You can use NPCs to create your own custom death reasons.


Related Functions

The following functions may be useful, as they are related to this function in one way or another.


Related Callbacks

The following callbacks might be useful, as they're related to this function in one way or another.

Personal tools
Navigation
Toolbox