just moving stuff in fakeclients over to functions. in the low pop helper plugin using a new native from mapchooser. skipping boost if first round and also including spectators now

This commit is contained in:
jenz 2026-04-14 22:45:35 +02:00
parent 208d084024
commit 8e33a8bd87
2 changed files with 59 additions and 42 deletions

View File

@ -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)
{

View File

@ -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,29 +458,31 @@ public void CheckPopulation()
KickFakeFromSpec();
}
}
else if (iPlayers >= 34 && iFakesInTeam + iFakesSpectate >= 16)
else if (48 > iPlayers > 44 && iFakesSpectate + iFakesInTeam < 13)
{
if (iFakesInTeam >= iFakesSpectate >= 0)
{
KickFakeFromTeam();
ManageFakes(iPlayersSpectate, iPlayersInTeam, iFakesInTeam, iFakesSpectate);
}
else if (iFakesSpectate >= iFakesInTeam >= 1)
else if (iPlayers < 42)
{
KickFakeFromSpec();
ManageFakes(iPlayersSpectate, iPlayersInTeam, iFakesInTeam, iFakesSpectate);
}
}
else if (iPlayers <= 32)
{
int some_number = 8;
if (iPlayersSpectate + iPlayersInTeam < some_number * 2)
{
some_number = 4;
}
if (iFakesSpectate + iFakesInTeam < iPlayersSpectate + iPlayersInTeam + some_number)
}
public void ManageFakes(int iPlayersSpectate, int iPlayersInTeam, int iFakesInTeam, int iFakesSpectate)
{
if (iPlayersSpectate + iPlayersInTeam + 6 > iFakesSpectate + iFakesInTeam)
{
CreateFake();
some_number = 8;
if (iPlayersSpectate + iFakesSpectate <= some_number * 2)
int max = 5;
if (iPlayersSpectate + iFakesSpectate > 16)
{
max = 8;
}
else if (iPlayersSpectate + iFakesSpectate < 9)
{
max = 3;
}
if (GetRandomInt(0, 10) > max)
{
SetFakeToSpectate();
}
@ -489,9 +491,18 @@ public void CheckPopulation()
SetFakeToTeam();
}
}
else if (iFakesSpectate + iFakesInTeam > iPlayersSpectate + iPlayersInTeam + some_number)
else
{
if (iPlayersSpectate + iFakesSpectate >= some_number * 2 && iFakesSpectate > 1)
int max = 5;
if (iPlayersSpectate + iFakesSpectate > 16)
{
max = 8;
}
else if (iPlayersSpectate + iFakesSpectate < 9)
{
max = 3;
}
if (GetRandomInt(0, 10) > max)
{
KickFakeFromSpec();
}
@ -500,7 +511,7 @@ public void CheckPopulation()
KickFakeFromTeam();
}
}
}
}
public void SetFakeToSpectate()