diff --git a/FakeClients/scripting/FakeClients.sp b/FakeClients/scripting/FakeClients.sp index e5f4767..baf5322 100755 --- a/FakeClients/scripting/FakeClients.sp +++ b/FakeClients/scripting/FakeClients.sp @@ -186,10 +186,24 @@ public void OnMapStart() public Action addfakes(Handle timer) { - CreateFake(); - if (GetRandomInt(0, 10) <= 3) + int fakes = 0; + for(int i = 1; i <= MaxClients; i++) + { + if (IsClientConnected(i) && IsClientInGame(i) && IsClientAuthorized(i)) + { + if (IsFakeClient(i) && !IsClientSourceTV(i)) + { + fakes++; + } + } + } + if (fakes < 16) { - SetFakeToTeam(); + CreateFake(); + if (GetRandomInt(0, 10) <= 3) + { + SetFakeToTeam(); + } } return Plugin_Continue; } @@ -411,19 +425,7 @@ public void CheckPopulation() { KickFakes(); } - else if (iPlayers > 50 && iFakesInTeam + iFakesSpectate >= 10) - { - KickFakes(); - } - else if (iPlayers >= 46 && iFakesInTeam + iFakesSpectate > 16) - { - KickFakes(); - } - else if (48 > iPlayers > 44 && iFakesSpectate + iFakesInTeam < 13) - { - ManageFakes(iPlayersSpectate, iPlayersInTeam, iFakesInTeam, iFakesSpectate); - } - else if (iPlayers < 42) + else if (iPlayers < 48) { ManageFakes(iPlayersSpectate, iPlayersInTeam, iFakesInTeam, iFakesSpectate); } @@ -469,15 +471,16 @@ public void KickFakes() public void ManageFakes(int iPlayersSpectate, int iPlayersInTeam, int iFakesInTeam, int iFakesSpectate) { - if (iPlayersSpectate + iPlayersInTeam + 4 < iFakesSpectate + iFakesInTeam) + int limit = 16; + if (iPlayersSpectate + iPlayersInTeam + 4 < iFakesSpectate + iFakesInTeam || iFakesSpectate + iFakesInTeam > limit) { KickFakes(); } - else if (iPlayersSpectate + iPlayersInTeam > iFakesSpectate + iFakesInTeam) + else if (iPlayersSpectate + iPlayersInTeam > iFakesSpectate + iFakesInTeam && iFakesSpectate + iFakesInTeam < limit) { CreateFake(); int max = 3; - if (iPlayersSpectate + iFakesSpectate > 16) + if (iPlayersSpectate + iFakesSpectate > limit) { max = 7; }