From d76f62b863edd7f2e9f30130520bef79d0a52a4f Mon Sep 17 00:00:00 2001
From: Nicholas Hastings <nshastings@gmail.com>
Date: Wed, 8 Oct 2014 14:34:10 -0700
Subject: [PATCH] Allow Steam IDs in Steam3 format for sm_addban

---
 plugins/basebans.sp | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/plugins/basebans.sp b/plugins/basebans.sp
index 363a2f5b..692195f2 100644
--- a/plugins/basebans.sp
+++ b/plugins/basebans.sp
@@ -301,7 +301,13 @@ public Action:Command_AddBan(client, args)
 	}
 
 	/* Verify steamid */
-	if (strncmp(authid, "STEAM_", 6) != 0 || authid[7] != ':')
+	new bool:idValid = false;
+	if (!strncmp(authid, "STEAM_", 6) && authid[7] == ':')
+		idValid = true;
+	else if (!strcmp(authid, "[U:", 3))
+		idValid = true;
+	
+	if (!idValid)
 	{
 		ReplyToCommand(client, "[SM] %t", "Invalid SteamID specified");
 		return Plugin_Handled;
@@ -342,13 +348,13 @@ public Action:Command_Unban(client, args)
 	ReplaceString(arg, sizeof(arg), "\"", "");	
 
 	new ban_flags;
-	if (strncmp(arg, "STEAM_", 6) == 0 && arg[7] == ':')
+	if (IsCharNumeric(arg[0]))
 	{
-		ban_flags |= BANFLAG_AUTHID;
+		ban_flags |= BANFLAG_IP;
 	}
 	else
 	{
-		ban_flags |= BANFLAG_IP;
+		ban_flags |= BANFLAG_AUTHID;
 	}
 
 	LogAction(client, -1, "\"%L\" removed ban (filter \"%s\")", client, arg);