From 288346d7d0dc9fc14d2e26188e277dfaa7149a89 Mon Sep 17 00:00:00 2001 From: zaCade Date: Fri, 24 Aug 2018 19:59:50 +0200 Subject: [PATCH] NoSteamPlayerCount: Slight formatting update. --- .../scripting/NoSteamPlayerCount.sp | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/NoSteamPlayerCount/scripting/NoSteamPlayerCount.sp b/NoSteamPlayerCount/scripting/NoSteamPlayerCount.sp index 4e0113fc..20dcc87b 100644 --- a/NoSteamPlayerCount/scripting/NoSteamPlayerCount.sp +++ b/NoSteamPlayerCount/scripting/NoSteamPlayerCount.sp @@ -29,14 +29,14 @@ public void OnGameFrame() //---------------------------------------------------------------------------------------------------- public void OnPluginStart() { - RegAdminCmd("sm_addfake", Command_addfake, ADMFLAG_ROOT, ""); - RegAdminCmd("sm_removefake", Command_removefake, ADMFLAG_ROOT, ""); - RegAdminCmd("sm_countfakes", Command_countfakes, ADMFLAG_BAN, ""); + RegAdminCmd("sm_addfake", Command_AddFake, ADMFLAG_ROOT, ""); + RegAdminCmd("sm_removefake", Command_RemoveFake, ADMFLAG_ROOT, ""); + RegAdminCmd("sm_countfakes", Command_CountFakes, ADMFLAG_BAN, ""); for(int client = 1; client <= MaxClients; client++) { - if(IsValidClient(client)) - OnClientAuthorized(client, "xxx"); + if(IsValidClient(client) && IsClientAuthorized(client)) + OnClientAuthorized(client, ""); } } @@ -55,7 +55,7 @@ public void OnPluginEnd() //---------------------------------------------------------------------------------------------------- // Purpose: //---------------------------------------------------------------------------------------------------- -public Action Command_addfake(int client, int argc) +public Action Command_AddFake(int client, int argc) { SteamWorks_CreateFake("Kaitou Sinbad"); return Plugin_Handled; @@ -64,7 +64,7 @@ public Action Command_addfake(int client, int argc) //---------------------------------------------------------------------------------------------------- // Purpose: //---------------------------------------------------------------------------------------------------- -public Action Command_removefake(int client, int argc) +public Action Command_RemoveFake(int client, int argc) { SteamWorks_KickFake(); return Plugin_Handled; @@ -73,7 +73,7 @@ public Action Command_removefake(int client, int argc) //---------------------------------------------------------------------------------------------------- // Purpose: //---------------------------------------------------------------------------------------------------- -public Action Command_countfakes(int client, int argc) +public Action Command_CountFakes(int client, int argc) { int iFakes = SteamWorks_CountFakes(); ReplyToCommand(client, "There are currently %d Fake Clients active.", iFakes); @@ -87,6 +87,7 @@ public void OnClientAuthorized(int client, const char[] auth) { char sSteamID[32]; GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID)); + char sName[128]; GetClientName(client, sName, sizeof(sName)); @@ -116,17 +117,14 @@ public void OnClientDisconnect(int client) //---------------------------------------------------------------------------------------------------- public bool IsValidClient(int client) { - if (client <= 0) - return false; + if (client <= 0) + return false; - if (client > GetMaxClients()) - return false; + if (client > GetMaxClients()) + return false; - if (!IsClientInGame(client)) - return false; + if (!IsClientInGame(client)) + return false; - if (!IsClientAuthorized(client)) - return false; - - return true; + return true; } \ No newline at end of file