bind 9 "impulse 9"
bind 0 "impulse 14" // cycles the superweapons
bind q weaplast
-bind MOUSE1 +attack
-bind MOUSE2 +attack2
+bind MOUSE1 +preattack
+bind MOUSE2 +preattack2
bind MOUSE3 +zoom
bind MOUSE4 weaplast
bind MOUSE5 +hook
bind JOY2 "+jump"
bind JOY3 "weapprev"
bind JOY4 "weapnext"
-bind JOY5 "+attack2"
-bind JOY6 "+attack"
+bind JOY5 "+preattack2"
+bind JOY6 "+preattack"
bind JOY7 "+zoom"
bind JOY8 "dropweapon"
bind JOY9 "menu_showteamselect"
set sv_vote_commands "restart fraglimit chmap gotomap nextmap endmatch reducematchtime extendmatchtime allready kick cointoss movetoteam_auto" "these commands can be voted"
set sv_vote_only_commands ""
set sv_vote_master_commands "movetoteam_red movetoteam_blue movetoteam_yellow movetoteam_pink" "maybe add kickban here (but then sv_vote_master 0)"
-set rcon_restricted_commands "restart fraglimit chmap gotomap endmatch reducematchtime extendmatchtime allready kick kickban \"sv_cmd bans\" \"sv_cmd unban\" status \"sv_cmd teamstatus\" movetoteam_auto movetoteam_red movetoteam_blue movetoteam_yellow movetoteam_pink"
+set rcon_restricted_commands "restart fraglimit chmap gotomap endmatch reducematchtime extendmatchtime allready kick kickban \"sv_cmd bans\" \"sv_cmd unban *\" status \"sv_cmd teamstatus\" movetoteam_auto movetoteam_red movetoteam_blue movetoteam_yellow movetoteam_pink"
set sv_vote_call 1 "users can call a vote for the above commands"
set sv_vote_master 1 "users can call a vote to become master"
set sv_vote_master_password "" "when set, users can use \"vlogin PASSWORD\" to log in as master"
alias allready "sv_cmd allready"
-// note: these cvars use weapon NUMBERS. Use the menu to edit this cvar, or look the numbers up in qcsrc/common/constants.qh.
seta cl_weaponpriority "minstanex rocketlauncher nex grenadelauncher fireball hlac hagar seeker crylink campingrifle uzi electro tuba shotgun laser hook porto" "weapon priority list"
seta cl_weaponpriority_useforcycling 0 "when set, weapon cycling by the mouse wheel makes use of the weapon priority list (the special value 2 uses the weapon ID list for cycling)"
seta cl_weaponpriority0 "rocketlauncher grenadelauncher hagar seeker fireball" "use impulse 200 for prev gun from this list, 210 for best gun, 220 for next gun. Default value: explosives"
seta cl_weaponpriority9 "" "use impulse 209 for prev gun from this list, 219 for best gun, 229 for next gun"
seta cl_weaponimpulsemode 0 "0: only cycle between currently usable weapons in weapon priority order; 1: cycle between all possible weapons on a key in weapon priority order"
+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
+
seta sv_status_privacy 1 "hide IP addresses from \"status\" replies shown to clients"
set g_maplist_allow_hidden 0 "allow hidden maps to be, e.g., voted for and in the maplist"
alias _gl_flashblend_update_11 "gl_flashblend 0"
alias gl_flashblend_update "_gl_flashblend_update_$r_shadow_realtime_dlight$r_showsurfaces"
+// this script allows swapping the primary and secondary fire buttons for any weapon, using the cl_swapattacks_* cvars.
+// 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 preattack_last 0
+set preattack2_last 0
+alias +preattack "firing_swap2 $firing_lastweapon; set preattack_last 1; +checkattack"
+alias -preattack "firing_swap2 $firing_lastweapon; set preattack_last 0; -checkattack"
+alias +preattack2 "firing_swap2 $firing_lastweapon; set preattack2_last 1; +checkattack2"
+alias -preattack2 "firing_swap2 $firing_lastweapon; set preattack2_last 0; -checkattack2"
+alias firing_switch_attack_0 ""
+alias firing_switch_attack2_0 ""
+alias firing_switch_attack_1 "+preattack"
+alias firing_switch_attack2_1 "+preattack2"
+alias firing_switch "-preattack; -preattack2; firing_switch_attack_$preattack_last; firing_switch_attack2_$preattack2_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_swap2 "firing_decision_${$1}"
+alias firing_swap "firing_swap2 cl_swapattacks_$1; set firing_lastweapon cl_swapattacks_$1; firing_switch"
+
+// 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 _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}"
set cl_lerpanim_maxdelta_framegroups 0.05 // must be faster than fastest weapon refire
set cl_lerpanim_maxdelta_server 0.1 // must be slower than slowest server controlled anim (e.g. animinfo stuff)
-// FIXME temporary
-set menu_font_size_snapping_fix 1
-
// player ID
seta _cl_userid "" "player ID (e.g. for tournaments)"