Teams in a gamemode.

This question is a simple, How do I make teams in a Gamemode? I have it derived from base, and I been fiddling around but I just can’t figure it out.

I’d take a look at this here library.

Namely, you use team.SetUp in your shared file.

Here’s an example from my own shared file I’m using for my Fretta gamemode:


function GM:CreateTeams()

team.SetUp( TEAM_RED, "Team Red", Color( 255, 80, 80 ), true )
team.SetSpawnPoint( TEAM_RED, "info_player_terrorist", "info_player_rebel"  )
team.SetClass( TEAM_RED , { "Runner", "Cavalry", "Assault", "Sniper", "Artillery", "Medic",} )

team.SetUp( TEAM_BLUE, "Team Blue", Color( 80, 80, 255 ), true )
team.SetSpawnPoint( TEAM_BLUE, "info_player_counterterrorist", "info_player_combine" )
team.SetClass( TEAM_BLUE, { "Runner", "Cavalry", "Assault", "Sniper", "Artillery", "Medic"} )

team.SetUp( TEAM_SPECTATOR, "Spectators", Color( 200, 200, 200 ), true )
team.SetSpawnPoint( TEAM_SPECTATOR, { "info_player_start", "info_player_terrorist", "info_player_counterterrorist" } ) 


Thanks I will fiddle around with that.


Also, how do you add playermodels to each team? So all of one team are rebels and all of one team are combine?

if ply:Team() == 1 then ply:SetModel(“models\Humans/Group03/male_03.mdl”)
elseif ply:Team() == 2 then ply:Setmodel(“models/Combine_Super_Soldier.mdl”)