Garry's Mod

Garry's Mod

[TTT2] Easy Custom Bindings
Dedicated Server - Duct Tape Method
The unfortunate reality of the world is people make useful things, but have their own lives and interests so sometimes those cool things stop working as intended. This little guy hasn't been updated since 2019 and doesn't seem to save the custom bindings anymore. I think I found a way to make them persist, but this does involve editing server files. There is probably a much safer and easier way of getting this to work, but I am no expert. So if you have a dedicated server running TTT2, this might work for you.

I have ULX and Ulib installed as well, but they might not be needed. You will need a program that can handle SQL stuff like this bad boy. [sqlitebrowser.org]

First, make sure both the Easy Custom Bindings addon and
this addon are installed.

Upon startup, the second addon should cause ECBs to log a command from it and it should appear in the console. Shut your server down and open the "garrysmod" folder in your server files.

Use your SQL tools to open the file labeled "sv.db" Fair warning, I think this is where TTT2 and other things store permanent settings, so be careful or else other stuff might stop working. Windows might give you a special warning as well, but you can just ignore it. It's just data at the end of the day Back it up if you are worried :D

Once you have the database file open, click the "Browse Data" tab and select the "ttt2_custombinds" table. You should already have an entry from the statistics addon.

Now we want to insert a new record into the table and can fill in the cells as follows:
  • Key - command you want to bind (You might be able to put anything else here but I didn't check)
  • Name - Name to be displayed as in TTT2's F1 bind menu
  • Category - "header_bindings_other" (You can change this, but this makes it look pretty.)
  • Command - the command you want to bind again (I think this is the one that is important)
  • Activated - 1

Once done, write the changes to the database file and reboot your server. The binding should show up under F1 and persist through restarts and map changes. As far as I know the ULX menu for this is just glitchy and will still wipe every restart so best just to ignore it.

If this doesn't help, doesn't make sense, or is complete gibberish I apologize. I am simply a casual TTT enjoyer who lost a bet, and needed a button that spawns a Maclunkey whenever pressed and this accomplished that.