HelpSwitching Teams

Posts 1–7 of 7 · Page 1 of 1
Switching Teams
I am working on an Infected mod.
It works perfectly in a private match
When somebody connects, he will be transfered to the survivor team (allies).
when somebody gets infected, he switches to the infected (axis) team.
this is also visible on the scoreboard (tab).

The problem is public matches.

When I host the mod in a public match, everybody end up in a "unknown" team.
As in, crosshair and name will be red when you aim on somebody, and they show up as enemies on the UAV/map
BUT... the game threads them as if they we're allies. (you cant kill a fellow survivor).
furthermore, when you look at the scoreboard, everybody appears to be in the same team, a nameless team.

So my quiestion is, how can i make everybody switch teams properly as in a private match?
Quote Originally Posted by henkspamadres View Post
I am working on an Infected mod.
It works perfectly in a private match
When somebody connects, he will be transfered to the survivor team (allies).
when somebody gets infected, he switches to the infected (axis) team.
this is also visible on the scoreboard (tab).

The problem is public matches.

When I host the mod in a public match, everybody end up in a "unknown" team.
As in, crosshair and name will be red when you aim on somebody, and they show up as enemies on the UAV/map
BUT... the game threads them as if they we're allies. (you cant kill a fellow survivor).
furthermore, when you look at the scoreboard, everybody appears to be in the same team, a nameless team.

So my quiestion is, how can i make everybody switch teams properly as in a private match?
The game mode you start the game in, could be F-F-A
No it isn't FFA, its Team Death Match. But it does look like an FFA scoreboard tbh.

And like i said, it works fine in Private Match, untill I try it in a public match.
Quote Originally Posted by henkspamadres View Post
No it isn't FFA, its Team Death Match. But it does look like an FFA scoreboard tbh.

And like i said, it works fine in Private Match, untill I try it in a public match.
Hard to help without the code. (As it's mostly like something you have done wrong there)
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.
A thing I forgot to mention:

The UAV/map shows strange things aswell. Everybody who shoots shows up as a red dot, and friendlies do not show up at all.
So, your uav is an empty map without the green triangles for friendles. And it shows a red dot if a team mate fires.
Basicly, the uav thinks everybody is an enemy.

Is this fixable?
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?