I'm equally befuddled. I can see how you're wanting to use the "loadcrosshairs" command with its second argument to specify a weapon for it.
After fiddling with this command for a while (about four months ago XD), I convinced myself that something must have been left out in the source code for the second argument.
Still, the first argument works fine, so we'll want to use that in some clever way.
You'll need to encase your script into an alias which is executed along with whatever you're using to select your next weapon.
(Note that I put parentheses around "curweapon". ;-)
Then make keybinds that select your weapons.
Other scripts that select various weapons will need to have that alias piggy-back them, too. For example, the "universaldelta" alias which is bound to the mouse scroll wheel by default is controlled by alias delta_game_0 (in scripts.cfg), and should be changed thus:
I may have rushed this conclusion -- hence its bulky nature and high probability of errors. Let me know how it works. :D
EDIT: If anyone reads this who knows the proper way to get the second argument for "loadcrosshairs" to behave the way in-game docs describe it, I'd be very eager to learn it. ^_^
After fiddling with this command for a while (about four months ago XD), I convinced myself that something must have been left out in the source code for the second argument.
Still, the first argument works fine, so we'll want to use that in some clever way.
You'll need to encase your script into an alias which is executed along with whatever you're using to select your next weapon.
[SELECT ALL] Code:
alias crosshairload [
if (= (curweapon) 0) [crosshairsize 50; loadcrosshair o.png] [] //knife
if (= (curweapon) 1) [crosshairsize 25; loadcrosshair default.png] [] //pistol
if (= (curweapon) 2) [crosshairsize 20; loadcrosshair o.png] [] //shotgun
if (= (curweapon) 3) [crosshairsize 20; loadcrosshair red_dot.png] [] //subgun
if (= (curweapon) 5) [crosshairsize 20; loadcrosshair red_dot.png] [] //assault rifle
if (= (curweapon) 6) [crosshairsize 50; loadcrosshair o.png] [] //grenades
]
Then make keybinds that select your weapons.
[SELECT ALL] Code:
bind "1" [primary; crosshairload]
bind "2" [secondary; crosshairload]
bind "3" [knife; crosshairload]
bind "4" [grenades; crosshairload]
Other scripts that select various weapons will need to have that alias piggy-back them, too. For example, the "universaldelta" alias which is bound to the mouse scroll wheel by default is controlled by alias delta_game_0 (in scripts.cfg), and should be changed thus:
[SELECT ALL] Code:
alias delta_game_0 [ if (= $arg1 1) [ shiftweapon 1 ] [ shiftweapon -1 ] ] // original
alias delta_game_0 [ if (= $arg1 1) [ shiftweapon 1; crosshairload ] [ shiftweapon -1; crosshairload ] ]
EDIT: If anyone reads this who knows the proper way to get the second argument for "loadcrosshairs" to behave the way in-game docs describe it, I'd be very eager to learn it. ^_^