NPC:OnPlayerDeath
Description:
Callback NPC:OnPlayerDeath is called when any player dies. This callback is called in the same way as the player's callback OnPlayerDeath.
Callback NPC:OnPlayerDeath was added in 0.3a and will not work in earlier versions! |
For the player version of this callback, check OnPlayerDeath. |
Parameters:
(playerid)
int | playerid | The player who has died. |
Return Values:
This callback does not handle returns.
Examples:
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.
- NPC:OnPlayerText: Called when player or NPC message is sent as a chat.
- NPC:OnClientMessage: Called when a client message is sent to the player (or to all players).