Home   Help Search Login Register  

Author Topic: Array related. Please help.  (Read 518 times)

0 Members and 1 Guest are viewing this topic.

Offline Nemesis6

  • Members
  • *
Array related. Please help.
« on: 20 Jul 2004, 15:39:23 »
I need to add an array of weapons inside the following script instead of just giving it ONE in the init field... help!

To start the script - this addEventHandler["fired",{(_this + ["LAWLauncher"]) exec "Effects\Units\BackBlast.sqs"}]
« Last Edit: 20 Jul 2004, 15:44:37 by Nemesis6 »
I am actually flying into a star... this is incredible!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Array related. Please help.
« Reply #1 on: 20 Jul 2004, 16:18:40 »
- You don't need to use private[] in an sqs script
- Why would you need the variable _blastweapon? Didn't see any reference to it later in the script...

You simply put in the script something like this:
_weps = ["LAWLauncher","RPGLauncher","9k32Launcher","CarlGustavLauncher"]

and then before the smoke drop stuff you put:

? !(_weapon in _weps): exit

That checks if the fired weapon is not in that weapon array, and if so exits the script so there's no backblast....
Or was this at all what you were after... ???

No guarantees that it will work though...


ECP does not use this kind of thing so they probably have another method of checking the weapon so riffles don't have backblast, but dunno how they do it...
« Last Edit: 20 Jul 2004, 16:20:16 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Nemesis6

  • Members
  • *
Re:Array related. Please help.
« Reply #2 on: 20 Jul 2004, 18:49:45 »
I'm in progress of testing what you're talking about in a seperate script... but for now, Stargate is in a commercial brake!


(By the way, I know what the different things do, I'm no rookie)
I am actually flying into a star... this is incredible!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Array related. Please help.
« Reply #3 on: 20 Jul 2004, 18:54:36 »
Quote
(By the way, I know what the different things do, I'm no rookie)
I just thought better safe than sorry...

because usually when replying shorly without explanations the next reply is asking 'wth is that??'.... :P
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Nemesis6

  • Members
  • *
Re:Array related. Please help.
« Reply #4 on: 20 Jul 2004, 20:41:11 »
No problem. It worked, thank you!! :-)
I am actually flying into a star... this is incredible!