OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: .pablo. on 25 Jun 2003, 18:59:34

Title: annoying foreach problem
Post by: .pablo. on 25 Jun 2003, 18:59:34
i want to have a single command which will remove the pipebombs from several groups of blackops.  this is the command i tried~

"_x removemagazines pipebomb" foreach (units group1 + units group2...etc)

only problem is that pipebomb has to be in quotes to work.  but if i have:

"_x removemagazines "pipebomb"" foreach (units group1 + units group2...etc)

then it will think the command is "_x removemagazines "



what do i do??
Title: Re:annoying foreach problem
Post by: LCD on 25 Jun 2003, 19:31:06
u need 2 put da pipebomb between double "" or use {} (second way only if u have 1.75 +)

so da line shud b

Code: [Select]
"_x removemagazines ""pipebomb""" foreach (units group1 + units group2...etc)
or

Code: [Select]
"_x removemagazines {pipebomb}" foreach (units group1 + units group2...etc)
LCD OUT
Title: Re:annoying foreach problem
Post by: Bremmer on 25 Jun 2003, 19:32:21
Hello Pablom

Try putting pipebomb in double inverted commas, like this ->

"_x removemagazines ""pipebomb""" foreach (units group1 + units group2...etc)

I think you need at least v1.75 to make this work though...

Cheers

[edit] Must be getting old ... my typing is slowing down ;) [/edit]
Title: Re:annoying foreach problem
Post by: .pablo. on 25 Jun 2003, 20:57:20
works perfectly now, thanks a lot!

edit:
another quick question, how do i add binoculars to the weapon loadout options before a mission?  do they go under weapons or magazines?
Title: Re:annoying foreach problem
Post by: Gielovic on 25 Jun 2003, 21:43:43
i think addweapon binocular
Title: Re:annoying foreach problem
Post by: Doolittle on 25 Jun 2003, 21:50:15
Double inverted commas???  Heh...it's called a QUOTE.

Doolittle
Title: Re:annoying foreach problem
Post by: LCD on 25 Jun 2003, 22:09:36
binocs go under weapons me thinks ;D

but u cud try dt :P

LCD OUT
Title: Re:annoying foreach problem
Post by: Bremmer on 25 Jun 2003, 22:43:58
Quote
Double inverted commas???  Heh...it's called a QUOTE.

 ???

/baffled