Garry's Mod Wiki

team

The team library gives you access to the team system built into the Source engine, and allows you to create custom teams and get information about them.

Methods

team.AddScore( number index, number increment )
Increases the score of the given team
number team.BestAutoJoinTeam()
Returns the team index of the team with the least players. Falls back to TEAM_UNASSIGNED
table team.GetAllTeams()
Returns a table consisting of information on every defined team
table team.GetClass( number index )
Returns the selectable classes for the given team. This can be added to with team.SetClass
table team.GetColor( number teamIndex )
Returns the team's color.
string team.GetName( number teamIndex )
Returns the name of the team.
table team.GetPlayers( number teamIndex )
Returns a table with all player of the specified team.
number team.GetScore( number teamIndex )
Returns the score of the team.
table team.GetSpawnPoint( number index )
Returns a table of valid spawnpoint classes the team can use. These are set with team.SetSpawnPoint.
table team.GetSpawnPoints( number index )
Returns a table of valid spawnpoint entities the team can use. These are set with team.SetSpawnPoint.
boolean team.Joinable( number index )
Returns if a team is joinable or not. This is set in team.SetUp.
number team.NumPlayers( number teamIndex )
Returns the amount of players in a team.
team.SetClass( number index, any classes )
Sets valid classes for use by a team. Classes can be created using player_manager.RegisterClass
team.SetColor( number teamIndex, table color )
Sets the team's color.
team.SetScore( number index, number score )
Sets the score of the given team
team.SetSpawnPoint( number index, any classes )
Sets valid spawnpoint classes for use by a team. GM.TeamBased must be set to true for this to work
team.SetUp( number teamIndex, string teamName, table teamColor, boolean isJoinable = true )
Creates a new team.
number team.TotalDeaths( number teamIndex )
Returns the sum of deaths of all players of the team.
number team.TotalFrags( Entity Entity or number )
Get's the total frags in a team.
boolean team.Valid( number index )
Returns true if the given team index is valid

Page Links


Special Pages


Wikis

?

Render Time: 33ms

DB GetPage 5
Generate Html 3
SaveChanges (1) 10
Render Body 0
Render Sidebar 12