CMD BLocker

I’d like a lua script to block the CMDs I put into the script, for say if a client types ‘hi’ into console, it will ban them/kick them(Kick preferably). Thanks :slight_smile:

goes to autorun/server
[lua]
concommand.Add(“Hi”, function(ply, cmd, args)
ply:Kick(“HI!”)
end)
[/lua]

I dont think that’s what he wants.

If he has a command to activate something, forexample rp_money 500 or something, he doesent want people to be able to write that.

Fix’d

Why should only admins be able to kick themselves? :colbert:

On-topic, your best bet would probably be gm_slog.

[lua]

if not ply:IsAdmin()
…^^^…
[/lua]

I was tired, okay? :v:

Say, if somebody types +hacks, then it will kick them



function AntiHax()
    ply:Kick("No hax!")
end
 
concommand.Add( "+hack", AntiHax )
concommand.Add( "+hacks", AntiHax )
concommand.Add( "+hax", AntiHax )
concommand.Add( "haxors", AntiHax )

**[Concommand.Add

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Concommand.Add)**

Isn’t that Server-Sided?

You’re trying to kick someone from a random server as a player?

Even if you’re talking about your server /facepalm…

Fixed she missed ply.

Nobody in this thread seems to realise that adding a command serverside will only be useful if the command doesn’t exist on the client.

[editline]10:40PM[/editline]

Sourcenet “ProcessNetCMD” hook (or a similarly named hook) is what you want.

Still blocks it either way.

Thanks for that. How can I make it check CVars and if they do not match, it will kick them/ban them?

Notice: Baconbot users do not get banned for using +Bacon_Menu

They changed the Console Command in V4, you can still detect by using other stuff though like file checking ect.

It’s the same. lol
How do you file check etc?

You forgot the ply argument… :3

Cubar Fixed it :stuck_out_tongue:

Cubar pointed that out earlier, and yea… :eng99: