fixed incorrect amount of fakeclients. added check for if autismbots are ingame. added them to being sillently renamed

This commit is contained in:
jenz 2024-06-26 22:45:04 +02:00
parent 070e6dc5b7
commit a801d5d3bf

View File

@ -271,7 +271,7 @@ public Action RandomizeNames(Handle timer)
ArrayList hClanNames = g_hClanNames.Clone();
for(int i = 1; i <= MaxClients; i++)
{
if(g_bFakePopulation[i] || IsClientAutismBot(i))
if(g_bFakePopulation[i] || (IsClientConnected(i) && IsClientInGame(i) && IsClientAutismBot(i)))
{
int iRand = GetRandomInt(0, hNames.Length - 1);
char sName[MAX_NAME_LENGTH];
@ -327,7 +327,7 @@ public Action UserMessage_SayText2(UserMsg msg_id, BfRead msg, const int[] playe
return Plugin_Continue;
}
if(g_bFakePopulation[client])
if(g_bFakePopulation[client] || (IsClientConnected(client) && IsClientInGame(client) && IsClientAutismBot(client)))
return Plugin_Handled;
return Plugin_Continue;
@ -521,8 +521,8 @@ public void CheckPopulation()
min = RoundToFloor(iPlayers * 0.1);
}
int randomAmount = GetRandomInt(min, max);
iFakesNeeded = randomAmount - iPlayers;
iFakesNeeded = GetRandomInt(min, max);
//iFakesNeeded = randomAmount - iPlayers;
if (iFakesNeeded < 0 || iPlayers > 25)
{
iFakesNeeded = 0;
@ -530,7 +530,7 @@ public void CheckPopulation()
}
else
{
iFakesInTeamNeeded = iFakesNeeded / 2;
iFakesInTeamNeeded = iFakesNeeded / 3;
}
if (iFakesInTeamNeeded < 0)
{