Jump to content
fawlty

Delete multiple squads

Recommended Posts

I've been using this to delete a single squad
{deleteVehicle _x;}forEach units b1_1;

How can I change this to delete multiple squads other than copy and paste the whole script and just change the variable names?

Share this post


Link to post
Share on other sites

Off the dome, maybe something like this:

private _unitArray = []; 
private _groups = [grp1,grp2,grp3,grp4]; //  group var names go here
 
{  
	private _units = units _x; 
	_unitArray append _units;  
} foreach _groups; 

{deleteVehicle _x} forEach _unitArray;

 

Basically just putting all relevant units into one array.

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
Spoiler

{  
	{
		deleteVehicle _x;
	} forEach units _x;
	deleteGroup _x;
} forEach [grp1,grp2,grp3,grp4]; //  group var names go here 

 

 

  • Like 1
  • Thanks 1

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

×