Gaffa 0 Posted July 24, 2009 Hi, I'm trying to find a script to remove any destroyed vehicle on the battlefield. None of the vehicles are in the mission when it starts, they all get spawned into it. I've tried searching but I can't find anything other than vehicle respawning which is not what I'm after... Thanks Share this post Link to post Share on other sites
Przemek_kondor 14 Posted July 24, 2009 Just add module "garbage collector" - it should take care of it Share this post Link to post Share on other sites
dale0404 5 Posted July 24, 2009 I believe the garbage collector only works if your using the functions that are in the game. Share this post Link to post Share on other sites
imutep 0 Posted July 24, 2009 Here is a snippet from Rommel i think. (Sorry, not 100% sure :rolleyes:) It removes all dead bodys, so maybe you can change it for vehicles. Activate: _xhandle = execvm "clearCorpses.sqf"; clearCorpses.sqf private ["_aU", "_dU"]; _aU = allUnits; while {true} do { sleep 60; if (count _aU != count allUnits) then { _dU = _aU - allUnits; {hidebody _x} foreach _dU; }; _aU = allUnits; }; Share this post Link to post Share on other sites
sbsmac 0 Posted July 24, 2009 Something like ... vehicleReaper = { while {true} do { { if ((count crew _x ==0) and (damage _x > 0.5)) then { deleteVehicle _x ; } ; } foreach vehicles ; sleep 1 ; } ; } ; if (isServer) then { [] spawn vehicleReaper;} ; Share this post Link to post Share on other sites