Counter-Strike 2

Counter-Strike 2

View Stats:
Binding button to switch between knife and primary
I want to use f to switch between knife and primary. So if i press it once with anything other than knife equipped it picks knife and the next time it goes to primary gun or secondary if there is no primary. How would i do this?
< >
Showing 1-5 of 5 comments
Omgwtfbbqkitten Oct 23, 2014 @ 9:22pm 
Binding primary and knife switch is easy, primary secondary and knife is a little more complicated.
Originally posted by Omgwtfbbqkitten:
Binding primary and knife switch is easy, primary secondary and knife is a little more complicated.
is there code somewhere for this. All i can find is primary to secondary and back.
Omgwtfbbqkitten Oct 23, 2014 @ 9:28pm 
Here are the scripts I use that might work for you.

This is for primary and secondary only.

// copy paste into your autoexec.cfg

alias weap_tog weap_tog1
alias weap_tog1 "slot1; alias weap_tog weap_tog2"
alias weap_tog2 "slot2; alias weap_tog weap_tog1"

Bind a key in console

bind "key" "weap_tog"

This was my gungame toggle for 1.6. Primary/secondary and knife. I am not sure if this will work for your purposes, but give it a try.

//autoexec

alias gg_tog gg_tog1
alias gg_tog1 "slot2; slot1; alias gg_tog gg_tog2"
alias gg_tog2 "use weapon_knife; alias gg_tog gg_tog1"

bind "key" "gg_tog"

*edit*

I updated the gg script because there was an issue with it working properly if you have a taser in your inventory. I changed the gg_tog slot3 with weapon_knife.

If you want the script to select your taser, use the slot3 in place of use weapon_knife. The script will select your taser over the knife. If you don't want your taser to come out every time use the use weapon_knife command as shown.
Last edited by Omgwtfbbqkitten; Oct 23, 2014 @ 9:45pm
.. Jun 23, 2015 @ 5:55pm 
ty
Here's the one I wrote and the one that function better to me cause when u dont have some weapon it doesnt get stuck and pull the knife istead so my q is my panic button and it aways brings the best option to my hand:

obs.: lastinv non grenade doesent work this way

//·············································································PRIMARY/SECONDARY
alias "primary" "slot2; slot3; slot1; bind q secondary"
alias "secondary" "slot1; slot3; slot2; bind q primary"
bind "q" "primary"
bind "1" "slot1; bind q secondary"
bind "2" "slot2; bind q primary"
//

and u can have my quickswitch as a gift ;)
its bound to spacebar since i use scrolldown to jump and bunny around

This is great if u want to have your knife for some time in your hand u just hold space and when u release your last weapon comes to hand.. good for runing or just tap to scopeout

//·············································································QUICKSWITCH
alias +knife slot3
alias -knife lastinv
bind space +knife
//

enjoy;...
< >
Showing 1-5 of 5 comments
Per page: 1530 50

Date Posted: Oct 23, 2014 @ 9:21pm
Posts: 5