SpawnClass.Team
From Liberty Unleashed Wiki
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:
int SpawnClass.Team
SpawnClass.Team = int team
Arguments
- team - The new team ID for the spawn class
Example 1. Returning
function onPlayerCommand( player, cmd, text ) { if ( cmd == "getteam" ) { local team = p_SpawnClass.Team; MessagePlayer( "The current spawn class team is: " + team, player ); } }
This example will return the team of the spawn class, that we found earlier in FindSpawnClass.
Example 2. Setting
function onPlayerCommand( player, cmd, text ) { if ( cmd == "setteam" ) { local team; if ( text ) team = text.tointeger(); if ( team ) p_SpawnClass.Team = team; } }
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.