Display settings gui

Is there any way to set the client video settings/bindings ? Or is there any way to oppen the options gui ?

Should work. Or not.

[lua]RunConsoleCommand(“gamemenucommand”, “openoptionsdialog”)[/lua]

Thank you.

What about creating new keyboard binds to add in the Keyboard section ?

Not possible via Lua as far as I know.

Ok, sorry but your command does not work, it does nothing…

I was sure Garry would not allow you to remake the ingame menu gui with even options feauture…

So, is there a way to directly set the video settings of the client ?

My command works, when you ran that Lua clientside and open the menu the options dialog will be open. However the things you are asking is impossible without modules.

So there’s no ways to change client video settings ?

Well if you open main menu, go to options and change it…

If you’re thinking about changing a client’s video settings, without them doing it themselves then of course there is no way. That would be very fucking dumb, and would allow you to mess with other clients so badly.

I found an interesting file : C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\garrysmod\cfg\client.vdf

You can read it through notepad++, and it contains vars from CSTM (Customizable Weaponry) and from the client settings, so it must be possible to change it via code, no ?

[editline]2nd April 2015[/editline]

The file config.cfg is defining client vars too, so maybe it’s possible…

Those convars are stored in there because they have the archive flag for them set when they are created, meaning they get archived. You can try and mess with the clients video settings through running various mat commands but that’s as far as you’re going to go.

So conclusion, there’s a complicated way, but there’s a way using Derma.

Indead the idea is not to set the video settings to crash the client, the idea is just to remake the ingame menu… That’s all. Remaking the ingame menu without changing menu files…

I have a last question, can you use bind command in a LocalPlayer():ConCommand() ? And will the bind be saved if I use LocalPlayer():ConCommand() ?

Wait, what? You don’t need to change video settings to change the in game menu, the escape menu? You make no sense, sir.

When you press escape this toggle an ingame menu gui, isn’t it ?

Well that’s simple, I managed to destroy the calls to this menu. Then I display my own one made using surface and draw directly.
I’ve done that for some reasons :

  • Make the player able to change GameMode key config,
  • Make the player able to switch to the website directly in game (using awesomium panel),
  • To add a button to reconnect to the server, in the case the gamemode client side is bugging and needs reload.

[editline]2nd April 2015[/editline]

So about my question I asked ?

You cannot bind commands to keys for players with Lua, for obvious security reasons.
You also cannot change video resolutions and other video options, and you should NOT even try to do so.

So there’s no ways to allow users to change GameMode keys to access different features, yay…

You can but the features you want to access could be used for malicious intent

Users can rebind keys and change video settings at will. There’s no programmatic way, since anything like that could be exploited by server owners.

The idea is to make the console useless for players !

Oh wait a minute, What about if I remake the way Source Engine manages binds ! I save binds in a client side file called config.dat using keyValues system (util.TableToKeyValues and inverse) then when the player connect back i save all binds in a big table and each time the player presses a button I make a hacky Think hook to get press state only one time, and then I search in the big bind table if any bind is saved, if that’s the case, LocalPlayer():ConCommand().

Would it be working this way ?

And then I would hook into PlayerBindPress and destroy this whole hook, so no longer anything is being called, then handle by myself when to move player.

Fuck that is the most horrible idea ever.

[sp] do it. [/sp]