Squirrel/Server/Events/Player/onPlayerCashChange

From Liberty Unleashed Wiki
Revision as of 09:39, 9 January 2010 by Sephiroth (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is called when a player's money amount is changed

Syntax

  1. function onPlayerCashChange( player, oldCash, newCash )

Parameters

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

Example

This example will message a player if their amount of money increases

  1.  
  2. function onPlayerCashChange( player, oldCash, newCash )
  3. {
  4. if ( oldCash < newCash ) MessagePlayer( "Your cash amount just increased", player );
  5. }
  6.  

Notes

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

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox