I wanted to know wether or not it was possible to force player to change team at some point during the game?
I want to do make a map like muselk's medics vs engineers.
That's a game mode, not a map. I believe Muselk has said in videos that its a custom plugin built by his friend Tava.
Is it possible to swap players within a map,
but it has limitations.
You need a
point_clientcommand, 2x
filter_activator_tfteam (one for red, one for blue), and as many trigger_multiple brushes as you need. In this example I have named my point_clientcommand as "ClientCommand" so I can sent it inputs.
In short, you create a trigger_multiple brush and give it the following outputs:
- OnStartTouch > ClientCommand > Command > jointeam blue > 0.00
- OnStartTouch > ClientCommand > Command > joinclass random > 0.10
This makes the player execute the join team command, then a moment later pick a random class when they touch the trigger_multiple brush. Naturally replace the 'jointeam blue' with 'jointeam red' if you want them to join the red team instead of blue. You don't have to include the command to specify which class they join and you can replace the 'random' with the name of the class you want to force. If you don't include it, the player is taken to the class selection screen to pick which class they want.
A precaution you'll want to take is filtering the trigger_multiples to the opposite team it will make the player join. In other words, if the brush will make the player join the red team, filter it for blue team members only. This way if a red player enters the brush, they won't be forced to join red (despite already being on red) and won't have a random class forced on them. And of course as we are using trigger_multiple brushes, you can have them enabled all the time or toggle when they are enabled or disabled via inputs.
Now about that limitation. This will
only work if the server hosting the map has the
sv_allow_point_servercommand set to "always", which many servers do not have enabled by default. If they don't have it enabled, this will not work.