Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- the idea of the example is to change the crosshair only while lg is being actually fired (could just as easily add in fov / sens changes to the alias as well)
- //---------- eg 1 -------------------------
- seta _GL "weapon 4;vstr _zFireOff"
- seta _RL "weapon 5;;vstr _zFireOff"
- seta _LG "weapon 6;vstr _zFireOn"
- seta _RG "weapon 7;vstr _zFireOff"
- alias +zfire "+attack;vstr _x5" //sets crosshair style (_x5).
- alias -zfire "-attack;vstr _cxStyle" //changes back to current default crosshair (_cxStyle).
- seta _zFireOn "bind mouse1 +zfire"
- seta _zFireOff "bind mouse1 +attack"
- //*********** the above works, BUT if you swap weapons as u hold fire -zfire doesn't trigger so you get stuck with the _cx5 crosshair
- //------------ eg 2----------------------
- seta _GL "weapon 4;vstr _zFireOff"
- seta _RL "weapon 5;;vstr _zFireOff"
- seta _LG "weapon 6;vstr _zFireOn"
- seta _RG "weapon 7;vstr _zFireOff"
- alias +zfire "+attack;vstr _x5" //sets crosshair style (_x5).
- alias -zfire "-attack;vstr _cxStyle" //changes back to current default crosshair (_cxStyle).
- seta _zFireOn "bind mouse1 +zfire"
- seta _zFireOff "-zfire;bind mouse1 +attack"
- //********the above version solves that problem, but now if you hold fire on lg, then change to another weapon (gaunt) then that will not fire until you let go of fire then press it again, as -zfire contains -attack which is being called as soon as you switch
- //----------- eg 3 --------------------
- bind MOUSE1 "+zfire"
- seta _GL "weapon 4;vstr _zFireOff"
- seta _RL "weapon 5;;vstr _zFireOff"
- seta _LG "weapon 6;vstr _zFireOn"
- seta _RG "weapon 7;vstr _zFireOff"
- alias +zfire "+attack;vstr _x5" //sets crosshair style (_x5).
- alias -zfire "-attack;vstr _cxStyle" //changes back to current default crosshair (_cxStyle).
- alias -zfire "-attack;vstr _cxStyle" //changes back to current default crosshair (_cxStyle).
- seta _zFireOn "alias +zfire "+attack;vstr _x5" // THIS LINE DOES NOT WORK AS U THINK
- seta _zFireOff "alias +zfire +attack"
- //************* in the above version mouse1 is ONLY ever bound o +zfire
- The theory is when you change weapons now , the contents of +zfire will change, but it will never get confused changign weapons, as it will always do -zfire when u let go now, insted of mising that out and doing -atack instead as the mouse was rebound to +attack
- but it fails to perform the desired crosshair change as _zFireOn only actually sets the alias +zfire to "+attack" then vstr _x5 runs a single time afterwards, not as part of an alias. as there is no grouping
- //------------- eg 4------------------
- seta _GL "weapon 4;vstr _zFireOff"
- seta _RL "weapon 5;;vstr _zFireOff"
- seta _LG "weapon 6;vstr _zFireOn"
- seta _RG "weapon 7;vstr _zFireOff"
- alias +zfire "+attack;vstr _x5" //sets crosshair style (_x5).
- alias -zfire "-attack;vstr _cxStyle" //changes back to current default crosshair (_cxStyle).
- alias -zfire "-attack;vstr _cxStyle" //changes back to current default crosshair (_cxStyle).
- seta _zFireOn "cl_noprint 1;exec zfire.cfg;cl_noprint 0"
- seta _zFireOff "alias +zfire +attack"
- //******** this final version works but only because we have a seperate .cfg file called zfire.cfg that contains only
- alias +zfire "+attack;vstr _x5"
- this seperate file method is the only way to either bind to more than one thing in a script, or script to chnge an alias to do more than one thing in a sript.
- if we had a way of doing grouping like ( ) or ' ' being different to " " or soemhting then everything could be nicely done in one file, with no hit on IO.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement