Squirrel/Server/Events/Player/onPlayerDeath
From Liberty Unleashed Wiki
(Difference between revisions)
m (Forgot return values >:/) |
|||
Line 10: | Line 10: | ||
* '''player''' - The player pointer | * '''player''' - The player pointer | ||
* '''reason''' - The weapon/reason which caused the player to die - check list [[Squirrel/Server/Constants#Weapons.2FDeath_Reasons|here]] | * '''reason''' - The weapon/reason which caused the player to die - check list [[Squirrel/Server/Constants#Weapons.2FDeath_Reasons|here]] | ||
+ | |||
+ | === Returns === | ||
+ | |||
+ | This event does not handle return values. | ||
== Example == | == Example == |
Latest revision as of 19:03, 22 December 2010
This is called when a player dies, for any reason.
[edit] Syntax
function onPlayerDeath( Player player, int reason )
[edit] Arguments
- player - The player pointer
- reason - The weapon/reason which caused the player to die - check list here
[edit] Returns
This event does not handle return values.
[edit] 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; }
[edit] Notes
The functions Message and Player.Name were used in this example. More info about them can be found in the corresponding pages.
[edit] Related Events
- onPlayerAction
- onPlayerArmourChange
- onPlayerCashChange
- onPlayerChat
- onPlayerCommand
- onPlayerConnect
- onPlayerDeath
- onPlayerFall
- onPlayerHealthChange
- onPlayerIslandChange
- onPlayerJoin
- onPlayerKeyStateChange
- onPlayerKill
- onPlayerPart
- onPlayerScoreChange
- onPlayerSkinChange
- onPlayerSpawn
- onPlayerUpdate
- onPlayerTeamChange
- onPlayerUseDetonator
- onPlayerVirtualWorldChange
- onPlayerWeaponChange