Small Lua question

Hello,

is it possible to print to console what people are executing in their console?
Like if they ran something like “rcon xxxxxx” then autoban?
I never looked for this function or so, thanks 4 your help!

It’s not quite possible currently in GMod as there are no hooks called when a player enters console commands, it’s recently been requested in the next update thread, but there’s no way to do it without a module.

Well thanks for your answer though! :slight_smile:

Acecool, please explain.

I see that disagree.

[editline]value[/editline]
I want to know…

I’ll go ahead and respond before I can’t for a few days ( issues are kicking up with neck / back causing me to come and go and I haven’t been able to be as active as I’d have liked even if it means 20+ hours down-time minimum per day; now I’m lucky to get 1 hour )…

A long time ago, when I first started messing with Lua in GMod, I made an InConsole Player meta-function to prevent capturing data while in console by combining a few other functions: http://wiki.garrysmod.com/page/gui/IsGameUIVisible and http://wiki.garrysmod.com/page/gui/IsConsoleVisible because while I was in console / main-menu, stuff in the game-mode would happen while I was typing away or pressing keys. Those functions exist to prevent things from happening when we’re in console or the main-menu for a reason.

It may not be “easy” or efficient without a module, but it can be done. I’ll do a more thorough type-up on the subject soon with a few examples.