diff --git a/NoSteamPlayerCount/scripting/NoSteamPlayerCount.sp b/NoSteamPlayerCount/scripting/NoSteamPlayerCount.sp index 5d2e56e4..28f87110 100644 --- a/NoSteamPlayerCount/scripting/NoSteamPlayerCount.sp +++ b/NoSteamPlayerCount/scripting/NoSteamPlayerCount.sp @@ -7,6 +7,9 @@ bool g_bHasFakeClient[MAXPLAYERS + 1] = {false,...}; +Handle g_hCVar_FakeClients = INVALID_HANDLE; +Handle g_hCVar_SourceTV = INVALID_HANDLE; + //---------------------------------------------------------------------------------------------------- // Purpose: //---------------------------------------------------------------------------------------------------- @@ -32,6 +35,11 @@ public void OnGameFrame() //---------------------------------------------------------------------------------------------------- public void OnPluginStart() { + g_hCVar_FakeClients = CreateConVar("sm_nosteamplayercount_fakeclients", "1", "Increse PlayerCount for Fake Clients", 0, true, 0.0, true, 1.0); + g_hCVar_SourceTV = CreateConVar("sm_nosteamplayercount_sourcetv", "1", "Increse PlayerCount for SourceTV", 0, true, 0.0, true, 1.0); + + AutoExecConfig(true, "plugin.NoSteamPlayerCount"); + RegAdminCmd("sm_addfake", Command_AddFake, ADMFLAG_ROOT, ""); RegAdminCmd("sm_removefake", Command_RemoveFake, ADMFLAG_ROOT, ""); RegAdminCmd("sm_countfakes", Command_CountFakes, ADMFLAG_BAN, ""); @@ -88,6 +96,12 @@ public Action Command_CountFakes(int client, int argc) //---------------------------------------------------------------------------------------------------- public void OnClientAuthorized(int client, const char[] auth) { + if (IsClientSourceTV(client) && (!GetConVarBool(g_hCVar_SourceTV))) + return; + + if (IsFakeClient(client) && (!GetConVarBool(g_hCVar_FakeClients))) + return; + char sSteamID[32]; GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID));