Player.Armour

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function sets/returns a given player's armour. Setting the amount of armour only affects the local player.

Syntax

  1. float Player.Armour( int Armour )

Arguments

  • Armour - What you can set the player's armour to.

Example 1. Returning

  1.  
  2. function onClientCommand( szCommand, szText )
  3. {
  4. local pPlayer = FindLocalPlayer( );
  5. if ( szCommand == "armour" )
  6. Message( "Your armour is " + pPlayer.Armour + "." );
  7. }
  8.  

This will tell the local player what their armour currently is.

Example 2. Setting

  1.  
  2. function onClientCommand( szCommand, szText )
  3. {
  4. local pPlayer = FindLocalPlayer( );
  5. if ( szCommand == "givemearmour" )
  6. pPlayer.Armour = 100;
  7. }
  8.  

This will set the local player's armour to 100 when they use the command /givemearmour

Notes

The call onClientCommand and Message were used in in this example. More info about them in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox