Player.Team

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

Syntax

  1. int player.Team
  1. player.Team = int value

Arguments

  • value - The ID of the team to assign to

Example 1. Returning

This will tell the player what team they are currently on when they type '/team'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "team" )
  5. {
  6. MessagePlayer( "Your current team is - " + pPlayer.Team, pPlayer );
  7. }
  8. return 1;
  9. }
  10.  

Example 2. Setting

This will set the player's team to '3' when they type '/team2'.

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

Notes

The function MessagePlayer and FindPlayer and event onPlayerCommand were used in these examples. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox