Counter-Strike 2

Counter-Strike 2

View Stats:
Adrax Apr 1, 2014 @ 6:56am
Bind toggle primary/secondary weapon?
Hello. Does somebody knows how to quickly toggle weapon 1 and 2. I have a working script but when I dont have one of these wepons I need to press mouse 2 times, otherwise it does not work.
How to get it to swap primary/secondary, and if I only have one and for instance I am having a knife in my hand, how to switch quickly with one click to one of them (when I only have one?

Basically I want something like that:
weapon 1 use weapon 1 or if not avaible switch weapon 2
weapon 2 use weapon 2 or if not avaible switch weapon 1
bind "key" toggle weapon1 / weapon 2
This script should work but how to write it?

I have:
alias switch$ "switch1"
alias switch1 "slot1; alias switch$ switch2"
alias switch2 "slot2; alias switch$ switch1"
How to get it to switch to other one if I only have one of them (I know I can click too times but I want only one click)

I have found somewhere in forum
http://steamcommunity.com/app/730/discussions/0/864958088518222091/
alias toggle "slota"

alias seta "alias toggle slota"
alias setb "alias toggle slotb"

alias slota "slot2;slot1;setb"
alias slotb "slot1;slot2;seta"

bind q "toggle"

bind 1 "slot1;setb"
bind 2 "slot2;seta"
bind 3 "slot3;seta"
bind 4 "slot4;seta"
bind 5 "slot5;seta"
bind 6 "slot6;seta"

But that does not work....
Last edited by Adrax; Apr 1, 2014 @ 7:51am
< >
Showing 1-10 of 10 comments
CrispyCube Jun 11, 2015 @ 5:46pm 
I've been trying so hard to figure this out and apparently it can all be solved with one command:
bind "key" "invnextnongrenade"
Mechjeb Jun 5, 2020 @ 9:41am 
doesn't work
Strange... he did say that it doesn't work after all.

It's easy. How can you not work it out?

bind mouse4 wswitch1
alias "wswitch1" "wswitch2"
alias "wswitch2" "slot1; slot2; alias wswitch1 wswitch3"
alias "wswitch3" "slot2; slot1; alias wswitch1 wswitch2"
souLT Jun 5, 2020 @ 9:44am 
All hail the necro king.
Köpsä Feb 23, 2022 @ 11:09am 
There is (I don't know since when) a native primary/secondary weapon toggle available. Just go to settings menu > controller > Swap primary / secondary. Bind any key to the command and you're done! Have fun. You can't find the control under the keyboard / mouse section which is a bit confusing.

P.S. I'm not sure which command you should use if you wish to bind the key through console/.cfg file.
Last edited by Köpsä; Feb 23, 2022 @ 11:10am
Red72 Feb 23, 2022 @ 11:10am 
Originally posted by Adrax:
Hello. Does somebody knows how to quickly toggle weapon 1 and 2. I have a working script but when I dont have one of these wepons I need to press mouse 2 times, otherwise it does not work.
How to get it to swap primary/secondary, and if I only have one and for instance I am having a knife in my hand, how to switch quickly with one click to one of them (when I only have one?

Basically I want something like that:
weapon 1 use weapon 1 or if not avaible switch weapon 2
weapon 2 use weapon 2 or if not avaible switch weapon 1
bind "key" toggle weapon1 / weapon 2
This script should work but how to write it?

I have:
alias switch$ "switch1"
alias switch1 "slot1; alias switch$ switch2"
alias switch2 "slot2; alias switch$ switch1"
How to get it to switch to other one if I only have one of them (I know I can click too times but I want only one click)

I have found somewhere in forum
http://steamcommunity.com/app/730/discussions/0/864958088518222091/
alias toggle "slota"

alias seta "alias toggle slota"
alias setb "alias toggle slotb"

alias slota "slot2;slot1;setb"
alias slotb "slot1;slot2;seta"

bind q "toggle"

bind 1 "slot1;setb"
bind 2 "slot2;seta"
bind 3 "slot3;seta"
bind 4 "slot4;seta"
bind 5 "slot5;seta"
bind 6 "slot6;seta"

But that does not work....
u cant just change it in settings?
null: Road to 4k Jul 20, 2022 @ 8:46pm 
simple solution:

bind "MOUSE4" "invnextitem"
bind "MOUSE5" "invnextnongrenade"

one is for switching between knife, zeus, etc..
one is for switching between primary and secondary weapons

I copied this from my config.cfg so it works. hf
null: Road to 4k Jul 20, 2022 @ 8:46pm 
Originally posted by Köpsä:
There is (I don't know since when) a native primary/secondary weapon toggle available. Just go to settings menu > controller > Swap primary / secondary. Bind any key to the command and you're done! Have fun. You can't find the control under the keyboard / mouse section which is a bit confusing.

P.S. I'm not sure which command you should use if you wish to bind the key through console/.cfg file.

yes but they took it out. idk why
Köpsä Feb 21, 2023 @ 10:46am 
Originally posted by null: Road to 2k:
Originally posted by Köpsä:
There is (I don't know since when) a native primary/secondary weapon toggle available. Just go to settings menu > controller > Swap primary / secondary. Bind any key to the command and you're done! Have fun. You can't find the control under the keyboard / mouse section which is a bit confusing.

P.S. I'm not sure which command you should use if you wish to bind the key through console/.cfg file.

yes but they took it out. idk why

I noticed that as well. I still got it working so it is there somewhere under the hood...
Sit Jul 31, 2023 @ 4:56am 
this makes my "hold button to select and throw grenade and quickswitch back to primary" work perfectly, if only having primary weapon the hold down function wouldn't work for secondary weapon. Nobody has this btw
pANDa Aug 13, 2023 @ 12:57am 
thank you this changes everything
< >
Showing 1-10 of 10 comments
Per page: 1530 50

Date Posted: Apr 1, 2014 @ 6:56am
Posts: 10