Scripting/Squirrel/Events/Player/onPlayerDeath

From VC-MP Wiki

Jump to: navigation, search

This is called when a player dies (e.g. after self-kill or drown).

Syntax

function onPlayerDeath( player, reason )

Parameters

  • player - The pointer of the player
  • reason - How did the player die

Example

This will message the chat when a player dies.

function onPlayerDeath( player, reason )
{
     Message( "**** " + player.Name + " died" );
}

Notes

The functions player.Name was used in in this example. More info about them in corresponding pages.

Related Events

Personal tools
squirrel scripting