Stupidly simple auto ban

Hai Thair
I believe this is a very simple request however i have not been able to find one of these on the forums so…

Could someone make a script that auto permabans anyone with a certain tag in their name?

Using ULX admin system for the ban

The desired tag for permaban is [FH]

Cheers in advance

This should do the trick :


function BanHook( ply )

	if string.find(ply:Name(), "[FH]") then
		ply :Ban(0, "I don't need to give you a reason!") -- Change that to whatever you like. :)
	end
 
end
 
hook.Add( "InitPostEntity", "BanHook", BanHook)

It can probably be done sooner in the joining process but I’m not sure the player object and it’s name would be available.

K cheers for that,will test soon

Or you could [lua]timer.Simple(15, function() code here end)[/lua] When they spawn PlayerInitialSpawn initial so it doesn’t crash the server with server shutting down give it 10 seconds.

That won’t work, InitPostEntity is only called once at the start of the map.

Yeah, PlayerInitialSpawn with a delay of about 0.3 should be fine.