Here is a compilation of some scripts I made you can save on the garrysmod/cfg folder as NAME_HERE.cfg files for driving vehicles in-game.
Script 1: Quick look-behind.
Description: Hold the mouse middle button for a quick look behind and around your car while driving.
No cfg file required, simply:
bind mouse3 +left
Script 2: Toggle handbrake
Description: Bind a key to toggle the handbrake ON and another key to toggle it OFF.
No cfg file required, simply:
bind KEY "+jump; +jump"
bind KEY2 -jump
Script 3: Cruise control
Description: Toggle cruise control at your current speed while driving by pressing middle mouse button.
Needs to be in a cfg file. You can create one by launching notepad, pasting the code and saving it as NAME_ME.cfg in garrysmod/cfg folder.
To run the script, open console and type "exec NAME_ME.cfg".
Bind 2 keys to enable and disable the cruise control toggle when pressing middle mouse button.
//REPLACE "KEY1/KEY2" by YOUR DESIRED KEYSTROKE
//Enables cruise toggle ON/OFF
bind KEY1 cruiseon
//Disables cruise toggle ON/OFF
bind KEY2 cruiseoff
alias cruise "+forward; +forward; bind mouse3 cruise2"
alias cruise2 "-forward; bind mouse3 cruise"
alias cruiseoff "bind mouse3 +left"
alias cruiseon "bind mouse3 cruise"
You can also change:
alias cruiseoff "unbind mouse3"
By
alias cruiseoff "bind mouse3 +left"
If you want the middle button to be bound to look behind.
Enjoy!
//Last tested 1.9.2024, working perfectly.
Script 1: Quick look-behind.
Description: Hold the mouse middle button for a quick look behind and around your car while driving.
No cfg file required, simply:
bind mouse3 +left
Script 2: Toggle handbrake
Description: Bind a key to toggle the handbrake ON and another key to toggle it OFF.
No cfg file required, simply:
bind KEY "+jump; +jump"
bind KEY2 -jump
Script 3: Cruise control
Description: Toggle cruise control at your current speed while driving by pressing middle mouse button.
Needs to be in a cfg file. You can create one by launching notepad, pasting the code and saving it as NAME_ME.cfg in garrysmod/cfg folder.
To run the script, open console and type "exec NAME_ME.cfg".
Bind 2 keys to enable and disable the cruise control toggle when pressing middle mouse button.
//REPLACE "KEY1/KEY2" by YOUR DESIRED KEYSTROKE
//Enables cruise toggle ON/OFF
bind KEY1 cruiseon
//Disables cruise toggle ON/OFF
bind KEY2 cruiseoff
alias cruise "+forward; +forward; bind mouse3 cruise2"
alias cruise2 "-forward; bind mouse3 cruise"
alias cruiseoff "bind mouse3 +left"
alias cruiseon "bind mouse3 cruise"
You can also change:
alias cruiseoff "unbind mouse3"
By
alias cruiseoff "bind mouse3 +left"
If you want the middle button to be bound to look behind.
Enjoy!
//Last tested 1.9.2024, working perfectly.
Attachments
Last edited: