Jump to content
Sign in to follow this  
Vegatry

How do I remove item foreach all side?

Recommended Posts

In the editor I place a trig with

on Act: _nul = execVM "noNVGIND.sqf";

and 3 Independent groups have init field with

group this = "group1";

group this = "group2";

group this = "group3";

noNVGIND.sqf:

waitUntil {isServer || !isNull player};
{
_x unassignItem "NVGoggles_INDEP";
_x removeItem "NVGoggles_INDEP";
};
} forEach [group1,group2,group3];

It doesn't works, perhaps is the JIP script doing the trick?

Edited by Vegatry

Share this post


Link to post
Share on other sites

you need to use "units groupX", since groupX is only the group's name. also there's a wrong }; that snuck it's way into your script :)

{_x unassignItem "NVGoggles_INDEP";_x removeItem "NVGoggles_INDEP"} forEach (units group1) + (units group2) + (units group3);

Share this post


Link to post
Share on other sites

If i get your thread title right, you want to remove it from all units on all sides.

This should handle this:

{
//do your stuff here
}forEach allUnits;

Share this post


Link to post
Share on other sites
{
  if ((side _x) == Independent) then {
    	  _x unassignItem "NVGoggles_INDEP";
         _x removeItem "NVGoggles_INDEP";
  };
} forEach allUnits;

Share this post


Link to post
Share on other sites
group this = "group1";

group this = "group2";

group this = "group3";

How does that even make sense?

Share this post


Link to post
Share on other sites
{
  if ((side _x) == Independent) then {
    	  _x unassignItem "NVGoggles_INDEP";
         _x removeItem "NVGoggles_INDEP";
  };
} forEach allUnits;

What struggles me is does it need script to prevent JIP player synchronization issue?

if yes, should it be(it's played on dedicated server):

waitUntil(isDedicated || !isNull player);

{

_x unassignItem "NVGoggles_INDEP";

_x removeItem "NVGoggles_INDEP";

};

} forEach allUnits;

or should the waitUntil statement included in the scope?

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  

×