SpawnClass.Team

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

This SpawnClass class member returns or sets the team ID for the given spawn class. If you want to use deathmatch teams set the team ID to INVALID_TEAM_ID (255).

Syntax

You can either return or set a new value using this member:

  1. int SpawnClass.Team
  1. SpawnClass.Team = int team

Arguments

  • team - The new team ID for the spawn class

Example 1. Returning

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "getteam" )
  5. {
  6. local team = p_SpawnClass.Team;
  7. MessagePlayer( "The current spawn class team is: " + team, player );
  8. }
  9. }
  10.  

This example will return the team of the spawn class, that we found earlier in FindSpawnClass.

Example 2. Setting

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "setteam" )
  5. {
  6. local team;
  7. if ( text ) team = text.tointeger();
  8. if ( team ) p_SpawnClass.Team = team;
  9. }
  10. }
  11.  

This example will set the team of the spawn class, that we found earlier in FindSpawnClass.

Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox