Jump to content
Sign in to follow this  
twiddlingthumbs

Selecting objects within an array

Recommended Posts

_people = [bob, John];

{removeUniform _x} forEach units _people;

{_x addUniform "U_mas_afr_O_rebel3"} forEach units _people;

//I can not get this to work, can someone please help and tell me what I am doing wrong.

I have named the units appropriately in the editor Bob and John.

Share this post


Link to post
Share on other sites

Try adding quotations "" around Bob and Johns name in the array. If the uniform is removed and the new one isn't added, check the classname.

Not sure if it matters when using commands, but I do know that soldiers cannot put on other faction's uniforms via the ammobox. Never tried with the command though.

Share this post


Link to post
Share on other sites
_people = [bob, John];

{removeUniform _x} forEach _people;

{_x addUniform "U_mas_afr_O_rebel3"} forEach _people;

Share this post


Link to post
Share on other sites

You could also condense it to one foreach loop

_people = [bob, John];

{
removeUniform _x;
_x addUniform "U_mas_afr_O_rebel3";
} forEach _people;

Less is always better. Instead of 4 loops, this only runs 2.

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  

×