diff --git a/AntiNoob/scripting/knockback_low_pop_modifier.sp b/AntiNoob/scripting/knockback_low_pop_modifier.sp index 63b7b8a..a605a4c 100644 --- a/AntiNoob/scripting/knockback_low_pop_modifier.sp +++ b/AntiNoob/scripting/knockback_low_pop_modifier.sp @@ -42,7 +42,7 @@ public void OnMapStart() { //Decided for now to exclude MaxPlayers //MaxTime, MinTime, MinPlayers, CooldownTime, MinHoursAvg - if (GetMapMaxTime(map) != 0 || GetMapMinTime(map) != 0 || GetMapMinPlayers(map) != 0 /*|| GetMapMaxPlayers(map) != 0*/ || GetMapCooldownTime(map) > 60 + if (GetMapMaxTime(map) != 0 || GetMapMinTime(map) != 0 || GetMapMinPlayers(map) != 0 /*|| GetMapMaxPlayers(map) != 0*/ || GetMapCooldownTime2(map) > 60 || GetMapMinHoursAvg(map) != 0) { g_bDoingMapTouristMode = true; @@ -52,17 +52,23 @@ public void OnMapStart() public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast) { + if (CS_GetTeamScore(CS_TEAM_T) == 0 && CS_GetTeamScore(CS_TEAM_CT) == 0) + { + return; + } + int active_player_count = 0; for (int i = 1; i <= MaxClients; i++) { - if(IsClientConnected(i) && IsClientInGame(i) && IsClientAuthorized(i) && !IsFakeClient(i) && !IsClientAutismBot(i) && !IsClientSourceTV(i) && GetClientTeam(i) > CS_TEAM_SPECTATOR) + if(IsClientConnected(i) && IsClientInGame(i) && IsClientAuthorized(i) && !IsFakeClient(i) && !IsClientAutismBot(i) && !IsClientSourceTV(i)) { active_player_count++; } } - if (active_player_count < 24) + int choosen_number = 24; + if (active_player_count < choosen_number) { int zombie_ratio = GetConVarInt(FindConVar("zr_infect_mzombie_ratio")); @@ -73,7 +79,7 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast) else if(knockback_increase < 1.0) knockback_increase = 1.0 - if (knockback_increase > 1.0 || (g_bDoingMapTouristMode && active_player_count < 18)) + if (knockback_increase > 1.0 || (g_bDoingMapTouristMode && active_player_count < choosen_number)) { if (g_bDoingMapTouristMode) { diff --git a/FakeClients/scripting/FakeClients.sp b/FakeClients/scripting/FakeClients.sp index fc963d3..1d974d4 100755 --- a/FakeClients/scripting/FakeClients.sp +++ b/FakeClients/scripting/FakeClients.sp @@ -425,7 +425,7 @@ public void CheckPopulation() } int iPlayers = iPlayersInTeam + iPlayersSpectate + iFakesInTeam + iFakesSpectate; - if (iPlayers >= 58) + if (iPlayers >= 55) { if (iFakesInTeam > 0) { @@ -436,7 +436,7 @@ public void CheckPopulation() KickFakeFromSpec(); } } - else if (iPlayers >= 48 && iFakesInTeam + iFakesSpectate >= 10) + else if (iPlayers > 50 && iFakesInTeam + iFakesSpectate >= 10) { if (iFakesInTeam >= iFakesSpectate >= 0) { @@ -447,7 +447,7 @@ public void CheckPopulation() KickFakeFromSpec(); } } - else if (iPlayers >= 43 && iFakesInTeam + iFakesSpectate >= 13) + else if (iPlayers >= 46 && iFakesInTeam + iFakesSpectate > 16) { if (iFakesInTeam >= iFakesSpectate >= 0) { @@ -458,49 +458,60 @@ public void CheckPopulation() KickFakeFromSpec(); } } - else if (iPlayers >= 34 && iFakesInTeam + iFakesSpectate >= 16) - { - if (iFakesInTeam >= iFakesSpectate >= 0) - { - KickFakeFromTeam(); - } - else if (iFakesSpectate >= iFakesInTeam >= 1) - { - KickFakeFromSpec(); - } - } - else if (iPlayers <= 32) + else if (48 > iPlayers > 44 && iFakesSpectate + iFakesInTeam < 13) { - int some_number = 8; - if (iPlayersSpectate + iPlayersInTeam < some_number * 2) + ManageFakes(iPlayersSpectate, iPlayersInTeam, iFakesInTeam, iFakesSpectate); + } + else if (iPlayers < 42) + { + ManageFakes(iPlayersSpectate, iPlayersInTeam, iFakesInTeam, iFakesSpectate); + } +} + +public void ManageFakes(int iPlayersSpectate, int iPlayersInTeam, int iFakesInTeam, int iFakesSpectate) +{ + if (iPlayersSpectate + iPlayersInTeam + 6 > iFakesSpectate + iFakesInTeam) + { + CreateFake(); + int max = 5; + if (iPlayersSpectate + iFakesSpectate > 16) { - some_number = 4; + max = 8; } - if (iFakesSpectate + iFakesInTeam < iPlayersSpectate + iPlayersInTeam + some_number) + else if (iPlayersSpectate + iFakesSpectate < 9) { - CreateFake(); - some_number = 8; - if (iPlayersSpectate + iFakesSpectate <= some_number * 2) - { - SetFakeToSpectate(); - } - else - { - SetFakeToTeam(); - } + max = 3; } - else if (iFakesSpectate + iFakesInTeam > iPlayersSpectate + iPlayersInTeam + some_number) + if (GetRandomInt(0, 10) > max) { - if (iPlayersSpectate + iFakesSpectate >= some_number * 2 && iFakesSpectate > 1) - { - KickFakeFromSpec(); - } - else - { - KickFakeFromTeam(); - } + SetFakeToSpectate(); + } + else + { + SetFakeToTeam(); } } + else + { + int max = 5; + if (iPlayersSpectate + iFakesSpectate > 16) + { + max = 8; + } + else if (iPlayersSpectate + iFakesSpectate < 9) + { + max = 3; + } + if (GetRandomInt(0, 10) > max) + { + KickFakeFromSpec(); + } + else + { + KickFakeFromTeam(); + } + } + } public void SetFakeToSpectate()