onClientHealthChange

From Liberty Unleashed Wiki
Revision as of 20:58, 11 April 2011 by Orpheus (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 the clients Health changes.

Syntax

  1. function onClientHealthChange( int iOldHealth, int iNewHealth )

Arguments

  • iOldHealth - The player's Old Health Value
  • iNewHealth - The player's New Health Value

Returns

  • 1 - No Effect
  • 0 - No Effect

Example

This example will Message the player when their cash changes

Create a Global for a player pointer.

  1. pPlayer <- FindLocalPlayer();
  1.  
  2. function onClientHealthChange( iOldHealth, iNewHealth ) {
  3. MessagePlayer("You have: " + pPlayer.Health + "Health remaining", pPlayer );
  4. return 1;
  5. }
  6.  

Notes

The functions MessagePlayer and Player.Health 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