Popular Post Zuma Posted June 20, 2022 Popular Post Report Share Posted June 20, 2022 (edited) In this guide I'll try to cover most of the useful techniques for binding weapons/sweps/entities. However, if I miss any techniques just let me know and I'll try my best to add them. Basic Binding Binding is done via a console command with the following syntax: bind <key> <command> It esentially allows you to run a command on a keypress, and most actions in DarkRP can be accessed via a command. Commands You can bind any command to a key, but the most common command's you'll use are the 'use' command and the 'say' command. Here's the syntax for both: use <swep> say <words> The 'use' command pulls out the weapon/swep you specify, and the say command will make you say whatever you put after it into the in-game chat. Here's how you'd bind these commands: bind <key> "use m9k_tec9" bind <key> "say /poo" For the 'use' command, you need to specifiy the swep using it's ID, which you can get by searching for the swep in the Q menu, right clicking it, and then selecting copy to clipboard: Config Files Config files are esentially lists of commands (or in this case binds) you want to run at certain times. You can find these files at: C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\cfg To better keep track of your binds, you can put them into 'autoexec.cfg'. This config file is run upon joining the server. This means if you overwrite these binds in-game, they will reset when you rejoin. Once the 'autoexec.cfg' config has run, you can run it or any other config file with the following command: exec <filename> However, this filename does not include the .cfg file extension. Alias Command The 'alias' command allows you to make a new command out of 1 or more pre-existing commands. Here's the syntax: alias <name> <commands> Alias commands allow you to do some cooler binds which I will explain later, but for now here's an example use: alias brute "say /brute" This creates a command called 'brute' which upon being run will make you say '/brute', which will therefore make you switch to brute. Cycle Binds Cycle binds are binds which rebind themselves. It basically allows you to bind multiple sweps/entities to 1 key. Here's an example that I use for moonshine: alias moonshine0 "say !buyalcohol; bind / moonshine1" alias moonshine1 "say !buydankjuice; bind / moonshine0" bind / moonshine0 'moonshine0' spawns alcohol then rebinds the / key to moonshine1 'moonshine1' spawns dank juice then rebinds the / key to moonshine0 This will create a loop where each time you press the / key, it will spawn the next moonshine entity. Finally, the bind command starts the loop by binding moonshine0 to the / key. Some more practical examples are for bhopping: alias bhop "use bhop_swep; bind MOUSE5 climb" alias climb "use climb_swep2; bind MOUSE5 bhop" bind MOUSE5 "bhop" Or for making a key pull out a new smg each time you press it: alias smg0 "use m9k_vector; bind g smg1" alias smg1 "use bb_mac10; bind g smg2" alias smg2 "use bb_tmp; bind g smg3" alias smg3 "use m9k_tec9; bind g smg4" alias smg4 "use m9k_mp9; bind g smg5" bind g smg0 Overlapping Binds (thanks to @Greeny7780 for the idea) If you want to have a bind pull out a different gun depending on the job, without using a job config file (see below), then you can overlap your binds. Say you want to bind MK14-EBR on Brute, but AK-47 on Rebellion, you would use a bind like this: bind <key> "use m9k_ak47; use unclen8_mk14" Since both Rebellion and Brute have AK-47, you need to put that first, since it will then default to AK-47, but change to MK14-EBR if it can. The pro's of using this method is that it's faster to setup, and let's you use the F4 menu instead of console, however you may find it easier to keep track of your binds and make changes with a seperate config. Job Binds As an alternative to overlapping binds, you can have a bind config per job, and have a different set of binds for each. Instead of putting your binds into 'autoexec.cfg' or directly into a console, put them into a config file named after the job the binds are for. Here's an example of what you could put in 'brute.cfg': alias bhop "use bhop_swep;bind MOUSE5 climb" alias climb "use climb_swep2;bind MOUSE5 bhop" bind MOUSE5 "bhop" alias moonshine0 "say !buyalcohol; bind / moonshine1" alias moonshine1 "say !buydankjuice; bind / moonshine0" bind / moonshine0 bind x "use unclen8_mk14" bind g "use m9k_tec9" bind f "use weapon_lightsaber" bind t "use m9k_m14sp" bind z "use m9k_ak47" bind b "use m9k_m249lmg" bind c "use m9k_m1918bar" bind v "use weapon_medkit" bind i "say /buyammo 7" say "/brute" say "/hitprice 10000" As well as binds for your favourite weapons on the job, you also need to add a line to run the command that will turn you into that job. Finally, I also added a line to set my hitprice to 10k. The last step to make this usable, is to add this line to 'autoexec.cfg': alias brute "exec brute" Now, instead of switching your job via the F4 menu, simply open the console and type the name of the job, this will then set all your binds, your hitprice if applicable, and change you into the job. Now there you go, you now have an unhealthy amount of binds. Was it worth the effort? Probably not. Edited July 7, 2022 by Zuma Added Greeny's overlapping method Vendaar, chenn, the cum man and 15 others 6 12 Link to comment
vice Posted June 20, 2022 Report Share Posted June 20, 2022 amazing guide, good job with this Zuma 1 Link to comment
AllayTheWolf Posted June 20, 2022 Report Share Posted June 20, 2022 This is very well thought out, well done Zuma! Very proud of you! Zuma 1 Link to comment
Zuma Posted July 7, 2022 Author Report Share Posted July 7, 2022 Updated with overlapping binds! (Thanks @Greeny7780) Greeny 1 Link to comment
nani Posted July 8, 2022 Report Share Posted July 8, 2022 Btw, with the overlapping guns (two guns per bind) if a job has both guns this can actually be a neat little trick to essentially have 2 guns on one key. The game actually gets the first gun out and then immediately gets the second one out, so you can use your “switch to previous weapon” key or whatever the hell its called to switch. For example, bind g “use bb_awp;use m9k_m14sp” I press g and it equips my M14. Now if I press the key that switches to my previous weapon, it will get out the awp. Also you dont need to rejoin to “refresh” your autoexec file. Just type “exec autoexec.cfg” into your console. Zuma 1 Link to comment
Caffe Posted July 16, 2022 Report Share Posted July 16, 2022 If you want to use BHOP swep and Climb more efficiently (with Magic Sword).. This is my method, perhaps someone has better solution and could share. // Binds bind mouse3 "+boostbhop" bind backspace "+boostclimb" // Magic Sword + BHOP alias +boostbhop "use weapon_lightsaber" alias -boostbhop "use bhop_swep" // Magic Sword + Climb alias +boostclimb "use weapon_lightsaber" alias -boostclimb "use climb_swep2" Replace mouse3 / backspace with whatever you want (I have backspace bound to a free key on my mouse, backspace was just a random key I had unbound). The way this works is, you hold down the key (whichever you chose), wait until the magic sword has fully deployed (doesn't work any other way and gmod doesnt have wait command to make better scripts, I tried several commands to delay the execution of a second command, eg. act etc, nothing worked) and then use +attack2 (typically right mouse click, I have something different). After you perform the jump, let go of the key. You will be then automatically switched to either BHOP swep or Climb. Takes a bit of practice at first, but once mastered, you'll be getting away real quick. The beauty of this method is that you are not forced to perform the jump if you don't want to. You can also use these same binds just to quickly switch to the swep. Need to climb somewhere quickly but don't need the full force of magic sword? Just press your key once and it will switch to the swep without jumping, if you didn't use +attack2. Good if your CJ has many tools/weapons under 1st key and trying to get out that climb/bhop swep in a tricky situation is troublesome. ========================================= Also, if you feel like your CJ has too many weapons under one key, you could reduce the amount of weapons you have under that key and also the order. I'll make one example with Rebellion and key 4. alias key4 "key41" // initially set the first weapon to be whatever alias key41 says alias key41 "use m9k_1897winchester; alias key4 key42" // 1st weapon is Winchester, set up alias key4 for the 2nd weapon alias key42 "use m9k_ithacam37; alias key4 key43" // 2nd weapon is Ithaca M37, set up alias key4 for the 3rd weapon alias key43 "use m9k_usas; alias key4 key41" // 3rd weapon is USAS, reset the key4 to the beginning of cycle bind 1 "slot1; alias key4 key41" // just need to reset the key4 alias, so when pressing 4 again the cycle starts from beginning bind 2 "slot2; alias key4 key41" // just need to reset the key4 alias, so when pressing 4 again the cycle starts from beginning bind 3 "slot3; alias key4 key41" // just need to reset the key4 alias, so when pressing 4 again the cycle starts from beginning bind 4 "key4" bind 5 "slot5; alias key4 key41" // just need to reset the key4 alias, so when pressing 4 again the cycle starts from beginning bind 6 "slot6; alias key4 key41" // just need to reset the key4 alias, so when pressing 4 again the cycle starts from beginning alias reset "bind 1 slot1; bind 2 slot2; bind 3 slot3; bind 4 slot4; bind 5 slot5; bind 6 slot6" // if you change job and want to reset keys back to original, write reset to console You can add more weapons if you want, heck, you could put all your weapons, sweps and physgun under number 1 if you want. Don't like the order of batons and pistols under key 2? No problem. If you want something custom and can't figure it out yourself, contact me and I will help. Keep in mind you'll have to use hud_fastswitch 1 for these things to work efficiently. Zuma 1 Link to comment
Enzo Posted July 20, 2022 Report Share Posted July 20, 2022 This is an elite guide. Also super friendly if you need to ask him any questions! Zuma, Caffe and AllayTheWolf 3 Link to comment
Zuma Posted July 20, 2022 Author Report Share Posted July 20, 2022 On 7/16/2022 at 6:20 PM, Caffe said: // Binds bind mouse3 "+boostbhop" bind backspace "+boostclimb" // Magic Sword + BHOP alias +boostbhop "use weapon_lightsaber" alias -boostbhop "use bhop_swep" // Magic Sword + Climb alias +boostclimb "use weapon_lightsaber" alias -boostclimb "use climb_swep2" I found out about + and - aliases the other day but couldn't think of a good use for them so this is very cool! On 7/16/2022 at 6:20 PM, Caffe said: alias key4 "key41" // initially set the first weapon to be whatever alias key41 says alias key41 "use m9k_1897winchester; alias key4 key42" // 1st weapon is Winchester, set up alias key4 for the 2nd weapon alias key42 "use m9k_ithacam37; alias key4 key43" // 2nd weapon is Ithaca M37, set up alias key4 for the 3rd weapon alias key43 "use m9k_usas; alias key4 key41" // 3rd weapon is USAS, reset the key4 to the beginning of cycle bind 1 "slot1; alias key4 key41" // just need to reset the key4 alias, so when pressing 4 again the cycle starts from beginning bind 2 "slot2; alias key4 key41" // just need to reset the key4 alias, so when pressing 4 again the cycle starts from beginning bind 3 "slot3; alias key4 key41" // just need to reset the key4 alias, so when pressing 4 again the cycle starts from beginning bind 4 "key4" bind 5 "slot5; alias key4 key41" // just need to reset the key4 alias, so when pressing 4 again the cycle starts from beginning bind 6 "slot6; alias key4 key41" // just need to reset the key4 alias, so when pressing 4 again the cycle starts from beginning alias reset "bind 1 slot1; bind 2 slot2; bind 3 slot3; bind 4 slot4; bind 5 slot5; bind 6 slot6" // if you change job and want to reset keys back to original, write reset to console This is something I would never have thought of. It will be very useful for taking weapons that I already have binded out of the weapon wheel. Thanks for sharing these techniques! Caffe 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now