entWatch4: Add 'sm_restrictions'.
This commit is contained in:
parent
aad210b5ce
commit
6eac03723d
@ -69,6 +69,8 @@ public void OnPluginStart()
|
|||||||
|
|
||||||
RegAdminCmd("sm_eban", Command_ClientRestrict, ADMFLAG_BAN);
|
RegAdminCmd("sm_eban", Command_ClientRestrict, ADMFLAG_BAN);
|
||||||
RegAdminCmd("sm_eunban", Command_ClientUnrestrict, ADMFLAG_UNBAN);
|
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;
|
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:
|
// Purpose:
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user