How to switch weapons and items using a command?
Obviously you should use keys instead of console to switch weapons and items, but combining buy bindings with key binds can streamline the buying phase. Using flashbang as an example, neither +weapon_flashbang
nor +flashbang
works for switching (the command purchases the item, but the key isn't bound):
bind f "weapon_flashbang;buy flashbang;"
bind f "flashbang;buy flashbang;"
Solution 1:
The settings to switch to a specific weapon slot are...
-
slot1
primary -
slot2
pistols -
slot3
knife -
slot4
grenades
or for a specific item you can use the command use <item name>
, such as use weapon_hegrenade
or use weapon_flashbang
These can all be used in binds or buy scripts:
bind <key> "buy ak47; slot1"
bind <key> "buy deagle; slot2"
or to switch to a specific item:bind <key> "buy hegrenade; use weapon_hegrenade"