ArmaMan360 94 Posted November 29, 2015 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
Tankbuster 1733 Posted November 29, 2015 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
davidoss 550 Posted November 29, 2015 { 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
R3vo 2652 Posted November 29, 2015 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
ArmaMan360 94 Posted November 29, 2015 && !(_x in (group player)) Wow thanks R3vo and Davidoss O.O Share this post Link to post Share on other sites