onPlayerDeath

From Liberty Unleashed Wiki
Revision as of 19:03, 22 December 2010 by Juppi (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This is called when a player dies, for any reason.

Syntax

  1. 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.

  1.  
  2. function onPlayerDeath( player, reason )
  3. {
  4. if ( reason == WEP_DROWNED ) Message( "* " + player.Name + " is sleeping with the fishes." );
  5. return 1;
  6. }
  7.  

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

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox