Squirrel/Client/Events/Player/onClientCashChange

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
Line 35: Line 35:
 
== Related Events ==
 
== Related Events ==
  
{{Squirrel/Squirrel/Client/Events/Player}}
+
{{Squirrel/Client/Events/Player}}

Revision as of 19:05, 11 April 2011

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This is called when the clients Cash changes.

Syntax

  1. function onClientCashChange( int iOldCash, int iNewCash )

Arguments

  • iOldCash - The player's Old Cash Value
  • iNewCash - The player's New Cash 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 onClientCashChange( iOldCash, iNewCash ) {
  3. MessagePlayer("You have: " + pPlayer.Cash, pPlayer );
  4. return 1;
  5. }
  6.  

Notes

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