plugins/basecommands.sp
changeset 925 2cd3d817b5ab
parent 924 330f478a2d1d
child 926 b42be6b5f221
     1.1 --- a/plugins/basecommands.sp	Fri Jun 08 03:38:57 2007 +0000
     1.2 +++ b/plugins/basecommands.sp	Fri Jun 08 03:50:23 2007 +0000
     1.3 @@ -44,6 +44,33 @@
     1.4  	RegAdminCmd("sm_execcfg", Command_ExecCfg, ADMFLAG_CONFIG, "sm_execcfg <filename>");
     1.5  	RegAdminCmd("sm_who", Command_Who, ADMFLAG_GENERIC, "sm_who [#userid|name]");
     1.6  	RegAdminCmd("sm_ban", Command_Ban, ADMFLAG_BAN, "sm_ban <#userid|name> <minutes|0> [reason]");
     1.7 +	RegAdminCmd("sm_unban", Command_Unban, ADMFLAG_UNBAN, "sm_unban <steamid>");
     1.8 +}
     1.9 +
    1.10 +public Action:Command_Unban(client, args)
    1.11 +{
    1.12 +	if (args < 1)
    1.13 +	{
    1.14 +		ReplyToCommand(client, "[SM] Usage: sm_unban <steamid>");
    1.15 +		return Plugin_Handled;
    1.16 +	}
    1.17 +	
    1.18 +	new String:arg[50], start=0;
    1.19 +	GetCmdArgString(arg, sizeof(arg));
    1.20 +	
    1.21 +	if (strncmp(arg, "STEAM_0:", 8) == 0)
    1.22 +	{
    1.23 +		start = 8;
    1.24 +	} else if (strncmp(arg, "0:1:", 4) == 0 || strncmp(arg, "0:0:", 4) == 0)
    1.25 +	{
    1.26 +		start = 2;
    1.27 +	}
    1.28 +	
    1.29 +	LogMessage("\"%L\" removed ban (filter \"%s\")", arg[start]);
    1.30 +	ServerCommand("removeid \"%s\"", arg[start]);
    1.31 +	ReplyToCommand(client, "[SM] %t", "Removed bans matching", arg);
    1.32 +	
    1.33 +	return Plugin_Handled;
    1.34  }
    1.35  
    1.36  public Action:Command_Ban(client, args)