Jump to content
Sign in to follow this  
dimdic

delete all objects & units inside a spefic area

Recommended Posts

Hi! Is there any way to delete all objects & units inside a specific area of my map ? Thank you.

Share this post


Link to post
Share on other sites

Well you could use the objectstodestroy = nearestobjects variable (as Horner suggested) from a given position and distance which would save the data into an array

then you could just {_x setdammage 1} foreach objectstodestroy;

Share this post


Link to post
Share on other sites

@Rej

I think he wanted to delete them. So you'd probably compile them into an array with nearestObjects then use this.

{deleteVehicle _x;} forEach _array;

Share this post


Link to post
Share on other sites

Yes Horner !! That's true! I wanted to delete them! The important thing was the idea of using the command "nearestObjects" !! Thank you a lot!

@Rej

I think he wanted to delete them. So you'd probably compile them into an array with nearestObjects then use this.

{deleteVehicle _x;} forEach _array;

Share this post


Link to post
Share on other sites

Remember to delete the crew of a vehicle before deleting the vehicle itself or else you'll end up with the crew still in the area.

Share this post


Link to post
Share on other sites

Ah yeah sorry in that case as Horner says: {deleteVehicle _x;} forEach _array;

Share this post


Link to post
Share on other sites

What shuko said. Make sure you use that foreach command first.

{
{
	deleteVehicle _x;
} forEach (crew _x);
} forEach (nearestObjects [getPos _pos, ["LandVehicle","Ship","Air","Tank"], 500]);

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  

×