Jump to content
Sign in to follow this  
Gaffa

Destroyed vehicle remover

Recommended Posts

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

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

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×