How can I ban a user from my dedicated server?

I have a Counter-Strike: Global Offensive dedicated server, and a few of my users are disobeying my rules (Ex. Cursing, blocking doorways purposely, spamming).

How can I ban these meanies from my server?


Are you running SourceMod? If so, just do sm_ban in the console.

If not, you should really consider installing it. It will help you manage the server and extend it's functionality by installing plugins.

http://www.sourcemod.net/


If you don't feel like installing SourceMod, there are a few basic commands you can use to ban people. These are banid and addip- banid bans a Steam ID (account), and addip bans an IP address.

To get the ID of a player, open the console in-game (~) and type status. You will get something similar to this:

hostname: Counter-Strike: Global Offensive
version : 1.32.5.1/13251 5595 secure  
udp/ip  : 10.1.0.111:27015
os      :  Windows
type    :  listen
map     : cs_motel at: 42 x, 1023 y, 64 z
players : 2 humans, 8 bots (20/0 max) (not hibernating)

# userid name uniqueid connected ping loss state rate adr
# 2 1 "Player" STEAM_1:0:XXXXXXXX 01:16 15 0 active 80000 xxx.xxx.xxx.xxx
# 3 1 "Meanie" STEAM_1:0:XXXXXXXX 01:16 13 0 active 80000 xxx.xxx.xxx.xxx
# 4 "Jason" BOT active
# 5 "Andy" BOT active
# 6 "Wyatt" BOT active
# 7 "Nate" BOT active
# 8 "Henry" BOT active
# 9 "Norm" BOT active
#10 "Mike" BOT active
#11 "Tom" BOT active
#end

Say meanie is being... well, a meanie and you want to ban him for half an hour. Let's ban him by userid (the first number in the line with his name in it.)

banid 30 3 kick

To explain this command:

"banid" is the command that does all the magic. As mentioned earlier, it bans steam accounts. It is used as follows:

banid < minutes > < userid > { kick }

so we are banning user 3 (meanie in this example) for 30 minutes, and kicking him off the server for good measure.

So let's say Meanie has come back half an hour later, and is hopping mad because you banned him earlier. You banned him for 0 minutes this time (permanantly) but he has outed himself now as a hacker with many accounts. Let's get rid of him for good this time, by banning his ip address. We run status again, and get this:

hostname: Counter-Strike: Global Offensive
version : 1.32.5.1/13251 5595 secure  
udp/ip  : 10.1.0.111:27015
os      :  Windows
type    :  listen
map     : cs_motel at: 42 x, 1023 y, 64 z
players : 2 humans, 8 bots (20/0 max) (not hibernating)

# userid name uniqueid connected ping loss state rate adr
# 2 1 "Player" STEAM_1:0:XXXXXXXX 01:16 15 0 active 80000 xxx.xxx.xxx.xxx
# 13 1 "Meanie 2" STEAM_1:0:XXXXXXXX 01:16 13 0 active 80000 xxx.xxx.xxx.xxx
# 4 "Jason" BOT active
# 5 "Andy" BOT active
# 6 "Wyatt" BOT active
# 7 "Nate" BOT active
# 8 "Henry" BOT active
# 9 "Norm" BOT active
#10 "Mike" BOT active
#11 "Tom" BOT active
#end

To do this, we're going to need his IP address which is helpfully given to us as the set of 4 numbers separated by dots on his status line (denoted as xxx.xxx.xxx.xxx in this example). Having noted that, let's look at addip:

addip < minutes > < ipaddress >

Ok, so let's ban this fool, for good this time

addip 0 xxx.xxx.xxx.xxx

Wait a second, that didn't kick him! He's still on the server. We'd better kick him off before he does any more damage. For that we can use the kick command, which does what it says- it kicks by player name. Unlike some other commands which need quotes, this one doesn't- even if the player's name has spaces.

kick Meanie 2

And he's gone. Sweet.