if(!ts_max) ts_max = tm.team_size;
else ts_max = max(ts_max, tm.team_size);
}
- if ((ts_max - ts_min) > 1)
+ if ((ts_max - ts_min) >= teamnagger)
{
s = strcat(blinkcolor, _("Teamnumbers are unbalanced!"));
tm = GetTeam(myteam, false);
spectatee_status = newspectatee_status;
// we could get rid of spectatee_status, and derive it from player_localentnum and player_localnum
+
+ teamnagger = (f & 0x60) >> 5; // 0x60 = BIT(5) | BIT(6)
}
NET_HANDLE(ENT_CLIENT_NAGGER, bool isnew)
return true;
}
-NET_HANDLE(TE_CSQC_TEAMNAGGER, bool isNew)
-{
- teamnagger = 1;
- return true;
-}
-
NET_HANDLE(TE_CSQC_PINGPLREPORT, bool isNew)
{
int i = ReadByte();
REGISTER_NET_TEMP(TE_CSQC_PICTURE)
REGISTER_NET_TEMP(TE_CSQC_RACE)
-REGISTER_NET_TEMP(TE_CSQC_TEAMNAGGER)
REGISTER_NET_TEMP(TE_CSQC_PINGPLREPORT)
REGISTER_NET_TEMP(TE_CSQC_WEAPONCOMPLAIN)
REGISTER_NET_TEMP(TE_CSQC_SERVERWELCOME)
ClientDisconnect(this);
}
-void send_CSQC_teamnagger() {
- WriteHeader(MSG_BROADCAST, TE_CSQC_TEAMNAGGER);
-}
-
int CountSpectators(entity player, entity to)
{
if(!player) { return 0; } // not sure how, but best to be safe
sf |= BIT(3); // observing blocked
if (autocvar_sv_showspectators == 1 || (autocvar_sv_showspectators && IS_SPEC(to)))
sf |= BIT(4); // show spectators
+ if (autocvar_sv_teamnagger && teamplay && !(autocvar_bot_vs_human && AVAILABLE_TEAMS == 2))
+ if (!MUTATOR_CALLHOOK(HideTeamNagger, this)) // enable teamnagger
+ sf |= (autocvar_sv_teamnagger & 0x03) << 5; // BIT(5) | BIT(6)
WriteHeader(MSG_ENTITY, ENT_CLIENT_CLIENTDATA);
WriteByte(MSG_ENTITY, sf);
ClientConnect
Called when a client connects to the server
+Do not send temp entity headers directly here, they may arrive before CSQC is ready.
=============
*/
void ClientConnect(entity this)
if (!autocvar_sv_foginterval && world.fog != "")
stuffcmd(this, strcat("\nfog ", world.fog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
- if (autocvar_sv_teamnagger && !(autocvar_bot_vs_human && AVAILABLE_TEAMS == 2))
- if(!MUTATOR_CALLHOOK(HideTeamNagger, this))
- send_CSQC_teamnagger();
-
CSQCMODEL_AUTOINIT(this);
CS(this).model_randomizer = random();
set g_balance_teams_remove_wait 10 "seconds to warn everyone before removing an excess player (0 = immediately)"
set g_changeteam_banned 0 "not allowed to change team"
-set sv_teamnagger 1 "enable a nag message when the teams are unbalanced"
+set sv_teamnagger 2 "enable a nag message when the teams are unbalanced, value sets team size difference threshold, 1 is recommended when g_balance_teams_queue is enabled"
set g_bloodloss 0 "amount of health below which blood loss occurs"