onPlayerDeath
From Liberty Unleashed Wiki
This is called when a player dies, for any reason.
Syntax
function onPlayerDeath( Player player, int reason )
Arguments
- player - The player pointer
- reason - The weapon/reason which caused the player to die - check list here
Returns
This event does not handle return values.
Example
This will send a message to the main chat if a player drowns.
function onPlayerDeath( player, reason ) { if ( reason == WEP_DROWNED ) Message( "* " + player.Name + " is sleeping with the fishes." ); return 1; }
Notes
The functions Message and Player.Name were used in this example. More info about them can be found in the corresponding pages.
Related Events
- onPlayerAction
- onPlayerArmourChange
- onPlayerCashChange
- onPlayerChat
- onPlayerCommand
- onPlayerConnect
- onPlayerDeath
- onPlayerFall
- onPlayerHealthChange
- onPlayerIslandChange
- onPlayerJoin
- onPlayerKeyStateChange
- onPlayerKill
- onPlayerPart
- onPlayerScoreChange
- onPlayerSkinChange
- onPlayerSpawn
- onPlayerUpdate
- onPlayerTeamChange
- onPlayerUseDetonator
- onPlayerVirtualWorldChange
- onPlayerWeaponChange