User panel stuff on forum
  8 posts on 1 page  1
Advanced Configuration
2010-11-16, 16:36
Member
793 posts

Registered:
Feb 2006
how can i check in a script for what weapon i have picked up?
say i want to bind my shotgun alias to mouse2 UNLESS i have Lg, would i just use "IF=weapon8 alias" or something?
ty
2010-11-16, 16:48
Member
693 posts

Registered:
Jan 2006
If I understand you correctly, an if statement is not necessary and you would need something as simple as this:

alias +lgsg "impulse 8 2; +attack"
alias -lgsg "-attack"

bind mouse2 +lgsg
2010-11-16, 16:53
Member
793 posts

Registered:
Feb 2006
gaz wrote:
alias +lgsg "impulse 8 2; +attack"
alias -lgsg "-attack"

bind mouse2 +lgsg

hm, no i want to only execute that IF i actually have Weapon 8 picked up. if i dont have it then i want to bind a totally different alias to the same key, mouse2 in that example.
2010-11-16, 16:56
Member
793 posts

Registered:
Feb 2006
i have two aliases and need a third one that switches the binding for the different commands.
i want to use blAze's sg switch toggle
2010-11-16, 17:11
Member
693 posts

Registered:
Jan 2006
Your OP suggests that you want mouse2 to fire SG unless you have LG, in which case it should fire LG. Well, the script above will do that for you - you don't need complicated if statements to do this.

This revised version will switch weapon back to shotgun after firing:

alias +lgsg "impulse 8 2; +attack"
alias -lgsg "-attack; impulse 2"

bind mouse2 +lgsg
2010-11-16, 17:24
Member
793 posts

Registered:
Feb 2006
gaz wrote:
mouse2 to fire SG unless you have LG, in which case it should fire LG.

first part is true, the last part not. i want specific weapon setups for different cases, ie. if i have lg or not.
thanks though.
2010-11-16, 17:49
Member
485 posts

Registered:
Feb 2006
Not sure what you want...

Pickup triggers and $weapons macro are blocked by ruleset smackdown. You can use f_weaponchange and $weapon to check wielded weapon.

But maybe this is what you mean:
alias wield_lgsg "weapon 8 2 5 4 1"
alias wield_lgssg "weapon 8 3 2 5 4 1"
alias wield_lg_wat wield_lgssg

alias +lgsgs "wield_lg_wat; +attack"
alias -lgsgs "-attack; weapon 2 4 1"

bind MWHEELUP "alias wield_lg_wat wield_lgsg"
bind MWHEELDOWN "alias wield_lg_wat wield_lgssg"
bind MOUSE2 +lgsgs
2010-11-16, 19:49
Member
793 posts

Registered:
Feb 2006
thanks Kalma

edit:
not sure i explained it properly. thanks for figuring it out, it's actually exactly what i want.

edit:
ok now i'm wondering if there is a way to use IF and $weapon somehow and make it shorter.
  8 posts on 1 page  1