diff --git a/FakePopulation/scripting/FakePopulation.sp b/FakePopulation/scripting/FakePopulation.sp index 5043d2a1..4aecc00b 100644 --- a/FakePopulation/scripting/FakePopulation.sp +++ b/FakePopulation/scripting/FakePopulation.sp @@ -246,9 +246,6 @@ public void CheckPopulation() { if (g_bFakePopulation[i]) iFakes++; - - if (g_bFakePopulation[i] && GetClientTeam(i) >= CS_TEAM_T) - iFakesInTeam++; } int iFakesNeeded = 0; @@ -329,9 +326,15 @@ public void CheckPopulation() } } + for(int i = 1; i <= MaxClients; i++) + { + if (g_bFakePopulation[i] && GetClientTeam(i) >= CS_TEAM_T) + iFakesInTeam++; + } + if (iFakes == iFakesNeeded && iFakesInTeam != iFakesInTeamNeeded && g_iAdminFakes == -1) { - if (iFakesInTeam < iFakesInTeamNeeded) + while (iFakesInTeam < iFakesInTeamNeeded) { for(int i = 1; i <= MaxClients; i++) { @@ -345,7 +348,7 @@ public void CheckPopulation() } } - if (iFakesInTeam > iFakesInTeamNeeded) + while (iFakesInTeam > iFakesInTeamNeeded) { for(int i = 1; i <= MaxClients; i++) {