From 7b9b90e2a249a52b44be91f690eb20bfd8900068 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 8 Jun 2007 03:50:23 +0000 Subject: [PATCH] added sm_unban --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40931 --- plugins/basecommands.sp | 27 +++++++++++++++++++++++++++ translations/plugin.basecommands.cfg | 6 ++++++ 2 files changed, 33 insertions(+) diff --git a/plugins/basecommands.sp b/plugins/basecommands.sp index ded18442..b1324eed 100644 --- a/plugins/basecommands.sp +++ b/plugins/basecommands.sp @@ -44,6 +44,33 @@ public OnPluginStart() RegAdminCmd("sm_execcfg", Command_ExecCfg, ADMFLAG_CONFIG, "sm_execcfg "); RegAdminCmd("sm_who", Command_Who, ADMFLAG_GENERIC, "sm_who [#userid|name]"); RegAdminCmd("sm_ban", Command_Ban, ADMFLAG_BAN, "sm_ban <#userid|name> [reason]"); + RegAdminCmd("sm_unban", Command_Unban, ADMFLAG_UNBAN, "sm_unban "); +} + +public Action:Command_Unban(client, args) +{ + if (args < 1) + { + ReplyToCommand(client, "[SM] Usage: sm_unban "); + return Plugin_Handled; + } + + new String:arg[50], start=0; + GetCmdArgString(arg, sizeof(arg)); + + if (strncmp(arg, "STEAM_0:", 8) == 0) + { + start = 8; + } else if (strncmp(arg, "0:1:", 4) == 0 || strncmp(arg, "0:0:", 4) == 0) + { + start = 2; + } + + LogMessage("\"%L\" removed ban (filter \"%s\")", arg[start]); + ServerCommand("removeid \"%s\"", arg[start]); + ReplyToCommand(client, "[SM] %t", "Removed bans matching", arg); + + return Plugin_Handled; } public Action:Command_Ban(client, args) diff --git a/translations/plugin.basecommands.cfg b/translations/plugin.basecommands.cfg index d00d8e3d..065fc409 100644 --- a/translations/plugin.basecommands.cfg +++ b/translations/plugin.basecommands.cfg @@ -58,4 +58,10 @@ "#format" "{1:s},{2:d},{3:s}" "en" "Banned player '{1}' for {2} minutes (reason: {3})." } + + "Removed bans matching" + { + "#format" "{1:s}" + "en" "Removed bans matching filter: {1}" + } }