basiscly, there are three ways to switch teams:
This adds the player to a team, without respawning him, and it doesn't change the model of the player.
self maps\mp\gametypes\_menus::addToTeam( "allies", true );
In a privatematch this is enough (except for the player model). The player will now show up in the correct team on the scoreboard and stuff.
the second and third method use the following function:
The [[level.axis]]() is the same as self notify..... because the game binds the function to level.axis.
self notify("menuresponse", game["menu_team"], "axis");
Furthermore, I've set the following dvars:
When a player needs to switch team, I either call the addtoteam() function or the level.<team>() function.
The result is the same. It works, but the scoreboard is messed up.
I think the problem is, that the game handles teams differently in a public match then it does in a private match, since my code works just fine in a private match.