NoSteamPlayerCount: Slight formatting update.

This commit is contained in:
zaCade 2018-08-24 19:59:50 +02:00
parent 477b7cb010
commit 288346d7d0

View File

@ -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;
}