Spawnpoints

Hello, i try to use the spawnpoints of Counter-Strike: Soruce on two different teams. The spawnpoint on the right spot, but both teams spawn on both sides.




function GM:CreateTeams()


	TEAM_ONE = 1
	team.SetUp( TEAM_ONE, "Team ONE", Color( 153, 0, 0 ) )
	team.SetSpawnPoint( TEAM_ONE, "info_player_counterterrorist" ) 
	
	TEAM_TWO = 2
	team.SetUp( TEAM_TWO, "Team TWO", Color( 255, 150, 0 ) )
	team.SetSpawnPoint( TEAM_TWO, "info_player_terrorist" )

	TEAM_SPECTATOR = 3
	team.SetUp( TEAM_SPECTATOR, "Team Spectator", Color( 0, 150, 0 ) )
	team.SetSpawnPoint( TEAM_SPECTATOR, "worldspawn" )



end




do you have some advices to use them properly?

A quick google search showed me this

Facepunch info on SetSpawnPoint

which showed this code

[lua]
function GM:PlayerSpawn(ply)
if ply:Team() == TEAM_WAIT then
local points = ents.FindByClass(“info_player_counterterrorist”)
ply:SetPos(points[math.random(1,#points)]:GetPos())
end
end
[/lua]

now that i look at it you basically copy’d his code made a few changes without caring to look further into his post to see how they fix’d the issue
:rollout:

[lua]
function GM:CreateTeams()

TEAM_WAIT = 1
team.SetUp( TEAM_WAIT, "Waiting", Color( 0, 0, 255 ) )
team.SetSpawnPoint( TEAM_WAIT, "info_player_counterterrorist" ) 

TEAM_BUILD = 2
team.SetUp( TEAM_BUILD, "Builders", Color( 255, 150, 0 ) )
team.SetSpawnPoint( TEAM_BUILD, "info_player_counterterrorist" ) 

TEAM_ATTACK = 3
team.SetUp( TEAM_ATTACK, "Attackers", Color( 255, 150, 150 ) )
team.SetSpawnPoint( TEAM_ATTACK, "info_player_terrorist" ) 

end
[/lua]

solved, thank you :smiley: