03-15-2021, 09:00 PM
(This post was last modified: 09-01-2022, 01:08 AM by Fearless Community. Edited 7 times in total.
Edit Reason: Fixed Encoding
)
Step by step guide on creating keybindings that can toggle on/off
Step #1 - Locate your cfg folder
Step #2 - Create a text document accordingly to what you want.
Step #3 - Open your document and paste the following format;
(Pre-made formats can be found on the end of the Post)
Step #4 - Saving your document.
Click on file > Save As...
Select "All Files" at 'Save as type'
Rename and save your document accordingly, edit the .txt to .cfg on the end of your document.
Step #5 - Locate the 'autoexec.cfg' file in the same folder.
Step #6 - Open 'autoexec.cfg' and typ in the following;
Step #7 - Ingame Console Command
Open your ingame console and use the following to run your keybinding without having to restart your Garrys Mod.
Formats for "Toggle Keybindings"
Toggle Voiceradio
Toggle Engine
Toggle Speaking Voiceradio
Toggle Crouching
Step #1 - Locate your cfg folder
Step #2 - Create a text document accordingly to what you want.
Step #3 - Open your document and paste the following format;
(Pre-made formats can be found on the end of the Post)
Quote:alias {name}_on "{command}; alias {alias name} {name}_off"
alias {name}_off "{command}; alias {alias name} {name}_on"
{name}_on
bind {keybinding} {alias name}
Step #4 - Saving your document.
Click on file > Save As...
Select "All Files" at 'Save as type'
Rename and save your document accordingly, edit the .txt to .cfg on the end of your document.
Step #5 - Locate the 'autoexec.cfg' file in the same folder.
Step #6 - Open 'autoexec.cfg' and typ in the following;
Quote:exec {name of your document}
Step #7 - Ingame Console Command
Open your ingame console and use the following to run your keybinding without having to restart your Garrys Mod.
Quote:exec {document name}
Formats for "Toggle Keybindings"
Toggle Voiceradio
Quote:alias radio_on "say /voiceradio on; alias toggleradio radio_off"
alias radio_off "say /voiceradio off; alias toggleradio radio_on"
radio_on
bind j toggleradio
Toggle Engine
Quote:alias engine_on "say /engine on; alias toggleengine engine_off"
alias engine_off "say /engine off; alias toggleengine engine_on"
engine_on
bind g toggleengine
Toggle Speaking Voiceradio
Quote:alias zoom_on "+zoom; alias togglezoom zoom_off"
alias zoom_off "-zoom; alias togglezoom zoom_on"
zoom_on
bind b togglezoom
Toggle Crouching
Quote:alias crouch_on "+duck; alias togglecrouch crouch_off"
alias crouch_off "-duck; alias togglecrouch crouch_on"
crouch_off
bind ctrl togglecrouch