Getting rid of Autocomplete Console Commands?

I have a ton of “Secret” console commands, But I’ve noticed that the console gives you a list of whatever you type in… Is there a way to turn this off? Or at least Hide the Commands? (Other than setting them Admin Only.)

The third argument to concommand.Add is an autocomplete table:func:string, so you may be able to do something with that to get it not to show, like function() return false end or something. I’ve never tried it before.

That’s only for arguments, though.


You need to create a console command that doesn’t use AddConsoleCommand or whatever the internal bind for it is. You can look at the source for Lua based console commands here.

Or you could simply make them chat commands.

Or require certain players or arguments in order for the command to work.

“secret_command 03jeje-helds9f39ij2peidq”

Where you had to match that exact string in order to run it.

Agreed, restricting it to a certain group of players really is the only way to make it secure.

Add the command serverside. Serverside commands don’t show in autocomplete. Though a user check should be done.

If your secret command is for some reason entirely clienside then there isn’t any way to secure it properly. If you still don’t have your amswer you’ll have to explain what it is you are trying to do.

[lua]
function engineCommandComplete( cmd, args )
if cmd == “SEKRUT” then return
else return concommand.AutoComplete( command, arguments ) end
end[/lua]

Try that?

So you want to override an engine command?

You don’t override the command, just the autocomplete.

I’ve also heard told that if you make the console command start with ~ then not only will it not shop up in autocomplete, it’s impossible for the player to enter the command.
I’ve never tried it but I’ve heard some people swear by it.

This is what copy and paste is for.

] lua_run concommand.Add("~asdf", function() print(‘fe’) end)
> concommand.Add("~asdf", function() print(‘fe’) end)…
] ~asdf
fe

And it still shows up in autocomplete.

If you are using a listen server for testing then that could possibly be why it shows up in autocomplete, try testing it on a dedicated server.

Just goes to show they were talking bollocks then. However it may be a place to start, putting an unprintable character in the console command name so they can’t possibly type it. How about byte 8? The backspace character?
Ok, now I have to try this out.

Remember that they don’t have to use the console to send console commands ; they can also run lua scripts. So no matter what name you use for a console command people will be able to call it.

And the person who made it probably wants to be able to call it.

It can be done with unprintable characters, however it makes it harder to use the command yourself. It will only accept printable characters as the first parameter, however this can be subverted by having the first parameter as “cmd” which executes the following parameters as code.


] lua_run concommand.Add(string.char(8), print)
> concommand.Add(string.char(8), print)...
] lua_run_cl RunConsoleCommand("cmd", string.char(8))
Player [1][Richard.Maw]        table: 238B3520

[editline]06:57PM[/editline]

The purpose wasn’t to stop people running the commands, he wants to make it so they can’t easily find them. They say when you implement Security through Obscurity you have neither, however the average player won’t know this.
If you really want to stop people using the commands though you need to check serverside whether they are allowed to run it.

Or even better, if they are not allowed to use it just print cmd…" not found." so they go like fuck wrong one.

I didn’t think this would be such a massive subject, Anyways to be clear. I’m trying to get it where if they type “in” (in console of course) It will not show “invisibility” in the drop down menu of the console, Or whatever you call it. Kind of like when you type fade in console, it shows you “FadeIn” and “FadeOut”. I want to hide that from the clients.
I just learned that there is an “Autocomplete” function for console commands, I see where people could have gotten confused about my question.

I still want people to be able to USE the commands, But only if they know the commands. I just don’t want them typing A through Z, in console finding all my commands.

I’ll try using a few of the methods posted here, But I made a found a Chat Comand System, It delays Massively… But at least it doesn’t tell them the commands.

Also, I always test this stuff out in Singleplayer, Is that considered a Listen Server?