NPC:OnPlayerDeath

From SA-MP Wiki

Jump to: navigation, search


NPC:OnPlayerDeath was added in SA-MP 0.3a This NPC callback was added in SA-MP 0.3a and will not work in earlier versions!


Image:32px-Circle-style-warning.png

Important
Note

For the player version of this callback, check OnPlayerDeath.


Description:

Just as the player version of the callback, this callback is called when any player dies.


Parameters:
(playerid)
playeridThe player who has died.


Return Values:

This callback does not handle returns.


Example Usage:

public OnPlayerDeath(playerid)
{
    new string[80], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
 
    format(string, sizeof(string), "Oh no %s! I didn't want you to die that way!", name);
    SendChat(string);
    return 1;
}

Related Callbacks

The following callbacks might be useful as well, as they are related to this callback in one way or another.

Personal tools
Navigation
Toolbox