From 6eac03723dcf5aa989535a3a319a84a9d4189110 Mon Sep 17 00:00:00 2001 From: zaCade Date: Wed, 10 Apr 2019 14:15:23 +0200 Subject: [PATCH] entWatch4: Add 'sm_restrictions'. --- _entWatch4/scripting/entWatch-restrictions.sp | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/_entWatch4/scripting/entWatch-restrictions.sp b/_entWatch4/scripting/entWatch-restrictions.sp index 6aa919c2..1b6e7382 100644 --- a/_entWatch4/scripting/entWatch-restrictions.sp +++ b/_entWatch4/scripting/entWatch-restrictions.sp @@ -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: //----------------------------------------------------------------------------------------------------