FakePopulation: hopefully last fixes

- KickClientEx --> KickClient
- check return value of CreateFakeClient
- add fakes in teams back
This commit is contained in:
Dogan 2019-10-09 22:13:06 +02:00
parent 0fcc2c6831
commit ca66dfa053

View File

@ -57,7 +57,7 @@ public void OnPluginEnd()
{
g_bFakePopulation[i] = false;
g_iLatency[i] = 0;
KickClientEx(i);
KickClient(i);
}
}
}
@ -255,33 +255,37 @@ public void CheckPopulation()
if (iPlayers > 61)
{
iFakesNeeded = 0;
iFakesInTeamNeeded = 0;
}
else if(iPlayers > 59)
{
iFakesNeeded = 1;
iFakesInTeamNeeded = 0;
}
else if(iPlayers > 57)
{
iFakesNeeded = 2;
iFakesInTeamNeeded = 1;
}
else if(iPlayers > 55)
{
iFakesNeeded = 3;
iFakesInTeamNeeded = 0;
iFakesInTeamNeeded = 1;
}
else if (iPlayers > 20)
{
iFakesNeeded = 4;
iFakesInTeamNeeded = 0;
iFakesInTeamNeeded = 2;
}
else if (iPlayers > 10)
{
iFakesNeeded = 3;
iFakesInTeamNeeded = 0;
iFakesInTeamNeeded = 1;
}
else if (iPlayers > 5)
{
iFakesNeeded = 2;
iFakesInTeamNeeded = 0;
}
else
{
@ -299,6 +303,9 @@ public void CheckPopulation()
int RandomName = GetRandomInt(0, NUMBEROFNAMES - 1);
int iIndex = CreateFakeClient(g_cName[RandomName]);
if(iIndex < 1 || iIndex > MaxClients)
return;
SetEntityFlags(iIndex, FL_CLIENT);
DispatchKeyValue(iIndex, "classname", "player");
DispatchSpawn(iIndex);
@ -322,7 +329,7 @@ public void CheckPopulation()
{
g_bFakePopulation[i] = false;
g_iLatency[i] = 0;
KickClientEx(i);
KickClient(i);
iFakes--;
break;
}