C# Class GarrysModLuaShared.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.
Show file Open project: OmegaExtern/gmod-csharp-binary-module

Public Methods

Method Description
AddScore ( LuaState luaState, uint teamIndex, uint increment ) : void

Increases the score of the given team.

BestAutoJoinTeam ( LuaState luaState ) : uint

Returns the team index of the team with the least players. Falls back to TEAM.TEAM_UNASSIGNED.

GetName ( LuaState luaState, uint teamIndex ) : string

Returns the name of the team.

GetScore ( LuaState luaState, uint teamIndex ) : int

Returns the score of the team.

Joinable ( LuaState luaState, uint teamIndex ) : bool

Returns if a team is joinable or not. This is set in SetUp.

NumPlayers ( LuaState luaState, uint teamIndex ) : uint

Returns the amount of players in a team.

SetClass ( LuaState luaState, uint teamIndex, object classId ) : void

Sets valid classes for use by a team. Classes can be created using player_manager.RegisterClass .

SetScore ( LuaState luaState, uint teamIndex, int score ) : void

Sets the score of the given team.

SetSpawnPoint ( LuaState luaState, uint teamIndex, object classes ) : void

Sets valid spawnpoint classes for use by a team.

TotalDeaths ( LuaState luaState, uint teamIndex ) : uint

Returns the sum of deaths of all players of the team.

TotalFrags ( LuaState luaState, uint teamIndex ) : uint

Returns the sum of frags of all players of the team.

Valid ( LuaState luaState, uint teamIndex ) : bool

Returns true if the given team index is valid.

Method Details

AddScore() public static method

Increases the score of the given team.
public static AddScore ( LuaState luaState, uint teamIndex, uint increment ) : void
luaState LuaState Pointer to lua_State struct.
teamIndex uint Index of the team.
increment uint Amount to increase the team's score by.
return void

BestAutoJoinTeam() public static method

Returns the team index of the team with the least players. Falls back to TEAM.TEAM_UNASSIGNED.
public static BestAutoJoinTeam ( LuaState luaState ) : uint
luaState LuaState Pointer to lua_State struct.
return uint

GetName() public static method

Returns the name of the team.
public static GetName ( LuaState luaState, uint teamIndex ) : string
luaState LuaState Pointer to lua_State struct.
teamIndex uint The team index.
return string

GetScore() public static method

Returns the score of the team.
public static GetScore ( LuaState luaState, uint teamIndex ) : int
luaState LuaState Pointer to lua_State struct.
teamIndex uint The team index.
return int

Joinable() public static method

Returns if a team is joinable or not. This is set in SetUp.
public static Joinable ( LuaState luaState, uint teamIndex ) : bool
luaState LuaState Pointer to lua_State struct.
teamIndex uint The index of the team.
return bool

NumPlayers() public static method

Returns the amount of players in a team.
public static NumPlayers ( LuaState luaState, uint teamIndex ) : uint
luaState LuaState Pointer to lua_State struct.
teamIndex uint The team index.
return uint

SetClass() public static method

Sets valid classes for use by a team. Classes can be created using player_manager.RegisterClass .
public static SetClass ( LuaState luaState, uint teamIndex, object classId ) : void
luaState LuaState Pointer to lua_State struct.
teamIndex uint Index of the team.
classId object A class ID or table of class IDs.
return void

SetScore() public static method

Sets the score of the given team.
public static SetScore ( LuaState luaState, uint teamIndex, int score ) : void
luaState LuaState Pointer to lua_State struct.
teamIndex uint Index of the team.
score int The team's new score.
return void

SetSpawnPoint() public static method

Sets valid spawnpoint classes for use by a team.
public static SetSpawnPoint ( LuaState luaState, uint teamIndex, object classes ) : void
luaState LuaState Pointer to lua_State struct.
teamIndex uint Index of the team.
classes object A spawnpoint classname or table of spawnpoint classnames.
return void

TotalDeaths() public static method

Returns the sum of deaths of all players of the team.
public static TotalDeaths ( LuaState luaState, uint teamIndex ) : uint
luaState LuaState Pointer to lua_State struct.
teamIndex uint The team index.
return uint

TotalFrags() public static method

Returns the sum of frags of all players of the team.
public static TotalFrags ( LuaState luaState, uint teamIndex ) : uint
luaState LuaState Pointer to lua_State struct.
teamIndex uint The team index.
return uint

Valid() public static method

Returns true if the given team index is valid.
public static Valid ( LuaState luaState, uint teamIndex ) : bool
luaState LuaState Pointer to lua_State struct.
teamIndex uint Index of the team.
return bool