moving fakes from team back to spec if too many

This commit is contained in:
jenz
2026-10-16 14:42:41 +02:00
parent 373e8ba1f2
commit 71d14c492e
+16
View File
@@ -537,6 +537,10 @@ public void CheckPopulation()
{ {
SetFakeToTeam(); SetFakeToTeam();
} }
else if (getFakesNeededInTeam() < fakes_in_team)
{
SetFakeToSpec();
}
} }
public bool nightTime() public bool nightTime()
@@ -573,6 +577,18 @@ public void SetFakeToTeam()
} }
} }
public void SetFakeToSpec()
{
for(int i = 1; i <= MaxClients; i++)
{
if(IsClientConnected(i) && IsClientInGame(i) && IsFakeClient(i) && !IsClientSourceTV(i) && GetClientTeam(i) > CS_TEAM_SPECTATOR)
{
ChangeClientTeam(i, CS_TEAM_SPECTATOR);
break;
}
}
}
public void CreateFake() public void CreateFake()
{ {
if (g_hNames.Length == 0 || g_hClanNames.Length == 0) if (g_hNames.Length == 0 || g_hClanNames.Length == 0)