// aliases:
alias +fire +attack
alias -fire -attack
-alias +fire2 +attack2
-alias -fire2 -attack2
-alias +attack2 +button3
-alias -attack2 -button3
+alias +fire2 +button3
+alias -fire2 -button3
+alias +attack2 +button3 // old alias from Nexuiz
+alias -attack2 -button3 // old alias name from Nexuiz
alias +zoom +button4
alias -zoom -button4
alias +crouch +button5
alias firing_swap "" // this script is located in its own config file
-// this hook activates when we switch weapons, and allows us to script weapon specific properties (like the fire button swapping script)
-alias cl_hook_activeweapon "firing_swap $1"
-
set sv_clones 0 "number of clones a player may make (reset by the \"kill\" command)"
set cl_handicap 1 "the higher, the more damage you will receive (client setting)"
alias cl_hook_gamestart_nexball
alias cl_hook_gamestart_cts
alias cl_hook_gameend
-//alias cl_hook_activeweapon
+alias cl_hook_activeweapon
alias _sv_hook_gamestart "set _sv_hook_gametype $1; _sv_hook_gamestart_stage2"
alias _sv_hook_gamestart_stage2 "sv_hook_gamestart_all; sv_hook_gamestart_${_sv_hook_gametype}"
--- /dev/null
+// This script allows swapping the primary and secondary fire buttons for any weapon
+//
+// To install, add
+// exec hook-firing_swap.cfg
+// to your autoexec.cfg
+
+// NOTE: if combined with other scripts that also hook cl_hook_activeweapon, do
+// alias cl_hook_activeweapon "firing_swap $1; commands of other scripts..."
+// after exec'ing them all from your autoexec.cfg
+
+// Set the cvars for each gun
+seta cl_swapattacks_tuba 0
+seta cl_swapattacks_laser 0
+seta cl_swapattacks_shotgun 0
+seta cl_swapattacks_uzi 0
+seta cl_swapattacks_campingrifle 0
+seta cl_swapattacks_grenadelauncher 0
+seta cl_swapattacks_electro 0
+seta cl_swapattacks_hlac 0
+seta cl_swapattacks_crylink 0
+seta cl_swapattacks_minstanex 0
+seta cl_swapattacks_nex 0
+seta cl_swapattacks_hagar 0
+seta cl_swapattacks_seeker 0
+seta cl_swapattacks_fireball 0
+seta cl_swapattacks_rocketlauncher 0
+seta cl_swapattacks_hook 0
+seta cl_swapattacks_porto 0
+
+// This part of the code is necessary to keep us firing when we switch weapons while holding a fire button pressed
+// Also updates the keys before firing, so we don't have to switch to another weapon and back to apply the changes
+set fire_last 0
+set fire2_last 0
+alias +fire "firing_swap_apply $firing_lastweapon; set fire_last 1; +checkattack"
+alias -fire "set fire_last 0; -checkattack"
+alias +fire2 "firing_swap_apply $firing_lastweapon; set fire2_last 1; +checkattack2"
+alias -fire2 "set fire2_last 0; -checkattack2"
+alias firing_switch_attack_0 ""
+alias firing_switch_attack2_0 ""
+alias firing_switch_attack_1 "+fire"
+alias firing_switch_attack2_1 "+fire2"
+alias firing_switch "-fire; -fire2; firing_switch_attack_$fire_last; firing_switch_attack2_$fire2_last;"
+
+// Now apply changes to the key binds and get the weapon we are using
+alias firing_decision_0 "alias +checkattack +attack; alias -checkattack -attack; alias +checkattack2 +attack2; alias -checkattack2 -attack2"
+alias firing_decision_1 "alias +checkattack +attack2; alias -checkattack -attack2; alias +checkattack2 +attack; alias -checkattack2 -attack"
+alias firing_swap_apply "firing_decision_${$1}"
+alias firing_swap "firing_swap_apply cl_swapattacks_$1; set firing_lastweapon cl_swapattacks_$1; firing_switch"
+
+// Not correct, but prevents firing from braking after executing the script until switching weapons
+alias +fire +attack
+alias -fire -attack
+alias +fire2 +attack2
+alias -fire2 -attack2
+
+// install
+alias cl_hook_activeweapon "firing_swap $1"
+++ /dev/null
-// This script allows swapping the primary and secondary fire buttons for any weapon
-
-// Set the cvars for each gun
-seta cl_swapattacks_tuba 0
-seta cl_swapattacks_laser 0
-seta cl_swapattacks_shotgun 0
-seta cl_swapattacks_uzi 0
-seta cl_swapattacks_campingrifle 0
-seta cl_swapattacks_grenadelauncher 0
-seta cl_swapattacks_electro 0
-seta cl_swapattacks_hlac 0
-seta cl_swapattacks_crylink 0
-seta cl_swapattacks_minstanex 0
-seta cl_swapattacks_nex 0
-seta cl_swapattacks_hagar 0
-seta cl_swapattacks_seeker 0
-seta cl_swapattacks_fireball 0
-seta cl_swapattacks_rocketlauncher 0
-seta cl_swapattacks_hook 0
-seta cl_swapattacks_porto 0
-
-// This part of the code is necessary to keep us firing when we switch weapons while holding a fire button pressed
-// Also updates the keys before firing, so we don't have to switch to another weapon and back to apply the changes
-set fire_last 0
-set fire2_last 0
-alias +fire "firing_swap_apply $firing_lastweapon; set fire_last 1; +checkattack"
-alias -fire "set fire_last 0; -checkattack"
-alias +fire2 "firing_swap_apply $firing_lastweapon; set fire2_last 1; +checkattack2"
-alias -fire2 "set fire2_last 0; -checkattack2"
-alias firing_switch_attack_0 ""
-alias firing_switch_attack2_0 ""
-alias firing_switch_attack_1 "+fire"
-alias firing_switch_attack2_1 "+fire2"
-alias firing_switch "-fire; -fire2; firing_switch_attack_$fire_last; firing_switch_attack2_$fire2_last;"
-
-// Now apply changes to the key binds and get the weapon we are using
-alias firing_decision_0 "alias +checkattack +attack; alias -checkattack -attack; alias +checkattack2 +attack2; alias -checkattack2 -attack2"
-alias firing_decision_1 "alias +checkattack +attack2; alias -checkattack -attack2; alias +checkattack2 +attack; alias -checkattack2 -attack"
-alias firing_swap_apply "firing_decision_${$1}"
-alias firing_swap "firing_swap_apply cl_swapattacks_$1; set firing_lastweapon cl_swapattacks_$1; firing_switch"
-
-// Not correct, but prevents firing from braking after executing the script until switching weapons
-alias +fire +attack
-alias -fire -attack
-alias +fire2 +attack2
-alias -fire2 -attack2
\ No newline at end of file