sold67 10 Posted May 7, 2013 Hi, I am not a scripter and having some trouble converting a script to where it is run only (If that makes any sense). I want it to delete all vehicles that are unoccupied in a defined range, so here is what I am currently using that runs via dev tool, but straight up deletes every vehicle: _vehicle = nearestObjects [player, ["Car","Air"], 50]; { deletevehicle _x } forEach _vehicle; Here is one I found which deletes only unocupied vehichles, but since I don't script I can't convert it! I would love any help it is driving me crazy. case 123: // Carmagedon { _distance = parseNumber(_inputText); if ((typeName _distance) == (typeName (1234))) then { player groupchat format["Starting Carmagedon at a range of %1 meters", _distance]; { { if ({alive _x} count crew _x == 0) then { deleteVehicle _x; }; } foreach((getpos player) nearObjects [_x, 15]); } forEach ["LandVehicle", "Air", "Car", "Motorcycle", "Bicycle", "UAV", "Wreck", "Wreck_Base", "HelicopterWreck", "UH1Wreck", "UH1_Base", "UH1H_base", "AH6_Base_EP1","CraterLong", "Ka60_Base_PMC", "Ka137_Base_PMC", "A10"]; } else { hint "ERROR: expected number"; }; }; Thank you. Share this post Link to post Share on other sites
Silderoy 1 Posted May 7, 2013 If you want to delete any unoccopied vehicle in the area, use that: _vehicle = nearestObjects [player, ["Car","Air"], 50]; { if (count crew _x == 0) then { deletevehicle _x; }; } forEach _vehicle; If you want to delete any unoccopied vehicle in the area that is alive, use that: _vehicle = nearestObjects [player, ["Car","Air"], 50]; { if ((alive _x) && ((count crew _x) == 0)) then { deletevehicle _x; }; } forEach _vehicle; Share this post Link to post Share on other sites
sold67 10 Posted May 10, 2013 You're a hero! Thank you ever so much. Share this post Link to post Share on other sites