Home   Help Search Login Register  

Author Topic: Chaning gear of several groupmembers  (Read 932 times)

0 Members and 1 Guest are viewing this topic.

Offline Zarele

  • Members
  • *
  • I'm a llama!
Chaning gear of several groupmembers
« on: 23 May 2008, 22:26:06 »
Hi,
I have several groups of fireteams. No I want to change some of the grear of several members but not al members.
Plt_S1 = squad 1
Plt_S2 is squad 2
Plt_S3 is squad 3

There are 4 members in each squad: Plt_S1_1, Plt_S1_2, Plt_S1_3, Plt_S1_4

Now I want to change the weapons For: Plt_S1_2, Plt_S1_4, Plt_S2_2, Plt_S2_4, Plt_S3_2, Plt_S3_4
But Plt_S1_1, Plt_S2_1, Plt_S3_1 and Plt_S1_3, Plt_S2_3, Plt_S3_3 has to have other weapons each.

How do I accomplish this? I tried using an array but that doesnt seem to work.
_Array1= [Plt_S1_2, Plt_S1_4, Plt_S2_2, Plt_S2_4, Plt_S3_2, Plt_S3_4]
"_x (removeallweapons this)" forEach _Array1


Offline Rommel92

  • Members
  • *
Re: Chaning gear of several groupmembers
« Reply #1 on: 24 May 2008, 03:41:02 »
You were close mate...
Code: [Select]
{removeAllweapons _x} forEach [Plt_S1_2, Plt_S1_4, Plt_S2_2, Plt_S2_4, Plt_S3_2, Plt_S3_4];

 :good:

Offline Zarele

  • Members
  • *
  • I'm a llama!
Re: Chaning gear of several groupmembers
« Reply #2 on: 26 May 2008, 11:40:37 »
THX!
worked great I even found out how to add weapons (just a change of place for the _x):

Code: [Select]
{_x addweapon "M16A2"} forEach [Plt_S1_2, Plt_S1_4, Plt_S2_2, Plt_S2_4, Plt_S3_2, Plt_S3_4]