How kick some player before he spawns?

So i make some addon that kick the player from XXX Country (Ping too high), but it can only kick when player spawn.

I think that is called Drop Connection.

So how kick the player using just SteamID or IP?

ban playername

[editline]27th November 2011[/editline]

ideally that should look up the playername’s steam ID and ban that

no I cannot ban the player or kick he if he is not spawned: ply:kick() on PlayerConnect do not give the player entity, so cannot KICK!

It’s worth noting that people with high pings do not lag other players, that is a myth about the Source engine.

However, this is how you would do something like that:

You need this module: http://www.facepunch.com/threads/695636

And then you can use this:

[lua]hook.Add(“PlayerPasswordAuth”, “KickPlayersPlayerConnect”, function(name, pass, steam, ip)
–Do something with the IP here, like a geolocation lookup

	--Replace with whatever you are checking
	if true then
		return {false, "Place a kick message here."}
	end
end

)[/lua]