Squirrel/Server/Functions/Players/Class

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ This function sets/returns the players class. == Syntax == <code>float Player.Class( int Value )</code> == Arguments == * '''Value''' - What you can set the class to. == Exa...)

Revision as of 02:37, 26 May 2010

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 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