basiscly, there are three ways to switch teams:
Code:
self maps\mp\gametypes\_menus::addToTeam( "allies", true );
This adds the player to a team, without respawning him, and it doesn't change the model of the player.
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:
Code:
self notify("menuresponse", game["menu_team"], "axis");
//and
[[level.axis]]();
The [[level.axis]]() is the same as self notify..... because the game binds the function to level.axis.
Furthermore, I've set the following dvars:
Code:
setDvar("scr_teambalance", 0);
setDvar("party_autoteams", 0);
setDvar("party_maxTeamDiff", 18);
setDvar("ui_allow_teamchange", "1");
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.