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.
Afficher le fichier Open project: OmegaExtern/gmod-csharp-binary-module

Méthodes publiques

Méthode 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 méthode

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.
Résultat void

BestAutoJoinTeam() public static méthode

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.
Résultat uint

GetName() public static méthode

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.
Résultat string

GetScore() public static méthode

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.
Résultat int

Joinable() public static méthode

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.
Résultat bool

NumPlayers() public static méthode

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.
Résultat uint

SetClass() public static méthode

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.
Résultat void

SetScore() public static méthode

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.
Résultat void

SetSpawnPoint() public static méthode

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.
Résultat void

TotalDeaths() public static méthode

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.
Résultat uint

TotalFrags() public static méthode

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.
Résultat uint

Valid() public static méthode

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.
Résultat bool