Player.Class

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

This function sets/returns the players class.

Syntax

  1. float Player.Class( int Value )

Arguments

  • Value - What you can set the class to.

Example 1. Returning

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "class" )
  5. {
  6. MessagePlayer( "Your class is " + pPlayer.Class + ".", pPlayer );
  7. }
  8. }
  9.  

This will tell the player what their class currently is.

Example 2. Setting

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "newclass" )
  5. {
  6. pPlayer.Class = 10;
  7. }
  8. }
  9.  

This will set the players class to 10 when they do /newclass.

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox