General > Developers Corner

Team Spawning

(1/1)

Doomed:
How would I go about adding a check to make sure an info_player_red or info_player blue exists on a given map? The gamemode can have 2 to 4 (red, blue, green or yellow) teams depending on the map and the way it is currently somebody may spawn on the green team although that team may not exist on that map.

JamminR:

From my understanding, spawn points are a 'class' of a map entity.
One way...
local red_spawns = ents.FindByClass( "info_player_red" )
local blue_spawns = ents.FindByClass( "info_player_blue" )
.. green ..
.. yellow ..

Then check if tables are empty.

Doomed:
thanks for reply, ya all i had to do was loop through the info_player_* ents.

Navigation

[0] Message Index

Go to full version