Well I need them all to be called differently when the target is hit. Each one will print different text representing the score for the part hit.
What I would like to do is once the target is hit all the triggers for that target are disabled. That way some one else cant shot the taget & mess up the score keeping.
Etc:
$rifletarget_triggerb is a head shot & will print "Head Shot! I Scored 10 Points" when hit. At that point I want all 11 triggers to become nottriggerable.
I know I can do it by nottriggerable - ing each one separate but was trying to get it so I didn't have to add 22 lines ( 11 nottriggerable lines & 11 triggerable lines )to each script for 3 target.
Is it possible or am I stuck adding all those lines??
Obstacle Course Timer
Moderator: Moderators
-
SniperWolf
- Colour Sergeant
- Posts: 89
- Joined: Sat Dec 18, 2004 5:14 am
- Location: New York, USA
- Contact:
-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
You could replace the letters in the targetnames with numbers 1-22 and do this:
If this was C, you could also leave everything as is and use this:
Try it, not sure if it'll work, though (don't really know how MoHAA handles chars).
Third option looks like this:
100% sure to work, although not as effective performance-wise (I'm an efficiency freak
).
I recommend you try the 2nd method first and then use this one if that doesn't work. 
Code: Select all
for (local.i = 1; local.i <= 22; local.i++)
$("rifletarget_trigger" + local.i) nottriggerableCode: Select all
for (local.i = 'a'; local.i <= 'z'; local.i++)
$("rifletarget_trigger" + local.i) nottriggerableThird option looks like this:
Code: Select all
local.alphabet = "a"::"b"::"c"::"d"::"e"::"f"::"g"::"h"::"i"::"j"::"k"::"l"::"m"::"n"::"o"::"p"::"q"::"r"::"s"::"t"::"u"::"v"::"w"::"x"::"y"::"z"
for (local.i = 1; local.i <= 22; local.i++)
$("rifletarget_trigger" + local.alphabet[local.i]) nottriggerable-
SniperWolf
- Colour Sergeant
- Posts: 89
- Joined: Sat Dec 18, 2004 5:14 am
- Location: New York, USA
- Contact:
Rookie
This code works perfectly. Thanks!
This code works perfectly. Thanks!
Code: Select all
for (local.i = 1; local.i <= 22; local.i++)
$("rifletarget_trigger" + local.i) nottriggerable
