Scripting/Squirrel/Events/Player/onPlayerCashChange

From VC-MP Wiki

Jump to: navigation, search

This is called when player's cash amount changes.

Syntax

function onPlayerCashChange( player, oldCash, newCash )

Parameters

  • player - The pointer of the player
  • oldCash - The amount of cash player had before the change
  • newCash - Player's current cash

Example

This example will tell the player if they got more money.

function onPlayerCashChange( player, oldCash, newCash )
{
     if ( oldCash < newCash ) MessagePlayer( "Yay! You got some more $$!", player );
}

Notes

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

Related Events

Personal tools
squirrel scripting