Squirrel/Server/Events/Player/onPlayerScoreChange

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|onPlayerScoreChange}} This is called when a player's score changes. == Syntax == <code>function onPlayerScoreChange( player, old, new )</code> === Arguments =…')

Revision as of 17:09, 8 November 2010

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, old, 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