FakePopulation: mask fakeplayer flag of bots

This commit is contained in:
BotoX 2019-10-04 12:25:53 +02:00
parent 6b0840458b
commit 84bf51a6d5

View File

@ -14,6 +14,7 @@ int g_iBaseLatency[MAXPLAYERS + 1];
int g_iLatency[MAXPLAYERS + 1]; int g_iLatency[MAXPLAYERS + 1];
int g_iAdminFakes; int g_iAdminFakes;
bool g_bCheckRequested; bool g_bCheckRequested;
int g_iUserInfoStringTable;
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
// Purpose: // Purpose:
@ -40,6 +41,8 @@ public void OnPluginStart()
CreateTimer(1.0, RandomizePing, _, TIMER_REPEAT); CreateTimer(1.0, RandomizePing, _, TIMER_REPEAT);
RequestFrame(CheckPopulation); RequestFrame(CheckPopulation);
g_iUserInfoStringTable = FindStringTable("userinfo");
} }
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
@ -167,6 +170,22 @@ public void OnClientDisconnect(int client)
} }
} }
public void OnClientSettingsChanged(int client)
{
if(!g_bFakePopulation[client])
return;
int len = GetStringTableDataLength(g_iUserInfoStringTable, client);
char[] aData = new char[len];
GetStringTableData(g_iUserInfoStringTable, client, aData, len);
// bool fakeplayer;
aData[105] = 0;
SetStringTableData(g_iUserInfoStringTable, client, aData, len);
}
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
// Purpose: // Purpose:
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------