onPlayerScoreChange

From Liberty Unleashed Wiki
Revision as of 17:16, 8 November 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's score changes.

Syntax

  1. function onPlayerScoreChange( Player player, int old, int new )

Arguments

  • player - The pointer of the player
  • old - The score player had before the change
  • new - The current score

Returns

This event does not handle return values.

Example

This will tell the player if they score just increased.

  1.  
  2. function onPlayerScoreChange( player, old, new )
  3. {
  4. if ( new > old ) MessagePlayer( "Your score increased from " + old + " to " + new, player );
  5. return 1;
  6. }
  7.  

Notes

The function MessagePlayer was used in this example. More info about it can be found in the corresponding page.

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox