Would this work? Number. 2

function Player( ply )
	local banned = {"XXX.XXX.XXX.XXX", "XXX.XXX.XXX.XXX"}
	local name = ply:Name()
	local SteamID = ply:SteamID()
	local ip = ply:IPAddress()
	print( "Player Connected. Name: " .. name .. " SteamID: " .. SteamID .. " IP: " .. ip )
		if (SteamID == "STEAM:XXXXXXXXX") then
		elseif (ip == banned) then

hook.Add("PlayerConnected", "Player", "Player")

No, it wouldn’t. It’s better to check for this stuff in in the CheckPassword hook anyways.

[lua]local banned = {“STEAM:0:EXAMPLE” = true, “STEAM:1:EXAMPLE” = true}

hook.Add(“CheckPassword”, “Bad apples”, function(steamID)
steamID = util.SteamIDFromBase64(steamID)

if (banned[steamID]) then
    return false, "You are banned."


You can get their name and IP from the hook as well. Visit the wiki for more info.

Also remember that this table will be cleared at map change, server restart, or server crash. If you want bans to persist you have to save the table.

Edit: this would be assuming you do not hard code the table, I was thinking about a ban function. A modified table would be reset when the Lua state resets.

It seems to be hardcoded in.

Yes I know. I just added the ban function for fun… I wanted it so when a player joins it says their Name Steam ID, etc. so it will be much easier.