Gamemode.CreateTeams

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameCreateTeams
SyntaxGM:CreateTeams( )
DescriptionSet up the teams.
ReturnsNil
Lua StateNewerShared.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.CreateTeams]Gamemode.CreateTeams [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]

Example

DescriptionSets up the Teams "Team USSR" and "Team USA"
Used onNewerShared.png
Code
 
function GM:CreateTeams()
 
    if ( !self.TeamBased ) then return end
 
	TEAM_USSR = 1
	team.SetUp( TEAM_USSR, "USSR/Russia", Color( 255, 0, 0, 255 ) )
	team.SetSpawnPoint( TEAM_USSR, "info_player_terrorist" )
 
	TEAM_USA = 2
	team.SetUp( TEAM_USA, "USA", Color( 0, 0, 255, 255 ) )
	team.SetSpawnPoint( TEAM_USA, "info_player_counterterrorist" )
 
end	
 
OutputCreate USSR/Russia and USA teams, and sets the special spawn points and team color.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox