Jump to content
ArmaMan360

problems with deleting AO objects

Recommended Posts

I am using the following script at the end of my random objectives mission to delete the entire spawned AO elements:

.....
{if (!(isplayer _x)) then {deleteVehicle _x;};} foreach nearestobjects [_setpos,[
	"air","StaticWeapon","Landvehicle"
	],1000];
	sleep 10;
{if (!(isplayer _x)) then {deleteVehicle _x;};} foreach nearestobjects [_setpos,[
	"man"
	],1000];

Works great. But, it also deletes my squad mates which belong to east side. And there are certain tasks which spawn near my base so I am afraid this script will delete the soldiers at my base  also as it deletes everything !(isplayer). I wish to add just a  side check in it along with !(isPlayer). I have tried this also but doesnt work:

{if (!(isplayer _x) && side _x == west) then {deleteVehicle _x;};} foreach nearestobjects [_setpos,[
	"air","StaticWeapon","Landvehicle"
	],1000];
	sleep 10;
{if (!(isplayer _x) && side _x == west) then {deleteVehicle _x;};} foreach nearestobjects [_setpos,[
	"man"
	],1000];

Any one? Thanks.

Share this post


Link to post
Share on other sites

Perhaps as you spawn all these objects, add them to a clear_up_later array. When the mission is done, do a deletevehicle on every object in the array

Share this post


Link to post
Share on other sites


{

if (!isplayer _x) then {

deleteVehicle _x;

};

} foreach nearestobjects [_setpos,["air","StaticWeapon","Landvehicle"],1000];

sleep 10;

{

if (!isplayer _x && side _x != west) then {

deleteVehicle _x;

};

} foreach nearestobjects [_setpos,["man"],1000];

Share this post


Link to post
Share on other sites

But, it also deletes my squad mates which belong to east side.

 

 

 

&& !(_x in (group player))

Share this post


Link to post
Share on other sites
&& !(_x in (group player))

 Wow thanks R3vo and Davidoss O.O

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

×