entWatch4: Add 'sm_restrictions'.

This commit is contained in:
zaCade 2019-04-10 14:15:23 +02:00
parent d09cd894dd
commit e8436a7c1c

View File

@ -69,6 +69,8 @@ public void OnPluginStart()
RegAdminCmd("sm_eban", Command_ClientRestrict, ADMFLAG_BAN);
RegAdminCmd("sm_eunban", Command_ClientUnrestrict, ADMFLAG_UNBAN);
RegConsoleCmd("sm_restrictions", Command_DisplayRestrictions);
}
//----------------------------------------------------------------------------------------------------
@ -157,6 +159,38 @@ public Action Command_ClientUnrestrict(int client, int args)
return Plugin_Handled;
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public Action Command_DisplayRestrictions(int client, int args)
{
char aBuf[1024];
char aBuf2[MAX_NAME_LENGTH];
for(int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i) && !IsFakeClient(i))
{
if(ClientRestricted(i))
{
GetClientName(i, aBuf2, sizeof(aBuf2));
StrCat(aBuf, sizeof(aBuf), aBuf2);
StrCat(aBuf, sizeof(aBuf), ", ");
}
}
}
if(strlen(aBuf))
{
aBuf[strlen(aBuf) - 2] = 0;
ReplyToCommand(client, "[SM] Currently restricted clients: %s", aBuf);
}
else
ReplyToCommand(client, "[SM] Currently restricted clients: none");
return Plugin_Handled;
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------