Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Garcia

Need a function

Recommended Posts

Ok, the problem is simple, I can't script functions for shit. So what I need is this. I've got an array of groups ([groupname1,groupname2,groupname3]), minimum 1 group, and max 5 groups will be in the array. I need a function that takes the array of groups, and adds every single unit from these groups to an array.

i.e, I've got 2 groups with 2 units in each. Then the array that I get back from the function is [unit1,unit2,unit3,unit4].

Thanks in advance to anyone out the who possibly is willing to make this one for me thumbs-up.gif

Share this post


Link to post
Share on other sites

Thats a nice quick one:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private ["_grparray","_result"];

_GrpArray=_This Select 0;

_Result=[];

{_Result=_Result+(Units _x)} ForEach _GrpArray;

_Result

Your ok with creating loading the sqf, aren't you?

Share this post


Link to post
Share on other sites

Seems I know that at least, yes wink_o.gif

Thanks a lot, works like a charm yay.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×