Player.Cash
From Liberty Unleashed Wiki
This function sets/returns a given player's cash. Setting the amount of cash only affects the local player.
Syntax
float Player.Cash( int Cash )
Arguments
- Cash - What you can set the player's cash to.
Example 1. Returning
function onClientCommand( szCommand, szText ) { local pPlayer = FindLocalPlayer( ); if ( szCommand == "cash" ) Message( "You have $" + pPlayer.Cash + "." ); }
This will tell the local player what their cash balance currently is.
Example 2. Setting
function onClientCommand( szCommand, szText ) { local pPlayer = FindLocalPlayer( ); if ( szCommand == "moremoney" ) pPlayer.Cash += 500; }
This will give the local player $500 more when they use the command /moremoney.
Notes
The call onClientCommand and Message were used in in this example. More info about them in the corresponding page.
Related Functions
- FindLocalPlayer
- FindPlayer
- Player.Angle
- Player.Armour
- Player.Cash
- Player.Class
- Player.Colour
- Player.Frozen
- Player.Health
- Player.ID
- Player.Immune
- Player.Island
- Player.Marker
- Player.Name
- Player.Ping
- Player.Pos
- Player.RemoveLimb
- Player.Score
- Player.Skin
- Player.Spawn
- Player.Team
- Player.Train
- Player.Vehicle
- Player.Velocity
- Player.VirtualWorld
- Player.WantedLevel
- Player.Weapon
- Player.WeaponAmmo
- Player.WeaponState