onPlayerCashChange

From Liberty Unleashed Wiki
Revision as of 18:42, 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's money amount is changed.

Syntax

  1. function onPlayerCashChange( Player player, int oldCash, int newCash )

Arguments

  • player - The player pointer
  • oldCash - Amount of cash prior to the detected change
  • newCash - Amount of cash after the detected change

Returns

This event does not handle return values.

Example

This example will message a player when they have more than $1,000,000.

  1.  
  2. function onPlayerCashChange( player, oldCash, newCash )
  3. {
  4. if ( oldCash > newCash && newCash > 1000000 ) MessagePlayer( "You're now a millionaire!", 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