Auto Delete Wrecked Vehicles Script (HOW ?)

You don't need the _isBuilding string in private up top or the line in the code as your cars will never be a building.
 
Looks good as long as you add
Code:
_this setVariable ["myCars",1,true];
to all your cars.

You can change myCars to whatever string you want, it just has to match in both files.
 
Looks good as long as you add
Code:
_this setVariable ["myCars",1,true];
to all your cars.

You can change myCars to whatever string you want, it just has to match in both files.

All my cars have this code + I have that same server_updateObject.sqf as stated in my last post, but vehicles don'T disappear when exploding... this is mind boggling hahaha. Testing this live in my server :(
 
Try changing it to:
Code:
if (((getDammage _object) > .9) && (_object getVariable "myCars" == 1)) exitWith { deleteVehicle _object; };

Also I noticed this line changed from the default:
Code:
if (_isNotOk) exitWith { deleteVehicle _object; };
 
Try changing it to:
Code:
if (((getDammage _object) > .9) && (_object getVariable "myCars" == 1)) exitWith { deleteVehicle _object; };

This works :D YAY! Only one thing left, it sometimes takes about 10-15 seconds or instantly to delete, anyway of adding a timer on it? Adn dude THANKS!!! :D


EDIT: I tried doing this code but doesnt work (doesnt add a timmer)
Code:
if (((getDammage _object) > .9) && (_object getVariable "myCars" == 1)) exitWith { sleep 60; deleteVehicle _object; };
 
Could maybe do a loop inside a waituntil to stall it out, not sure why the sleep isn't working.
 
Could maybe do a loop inside a waituntil to stall it out, not sure why the sleep isn't working.

Yeah I was sure that would work hehe, just funny because I run a Extreme pvp server with jets and tanks and such, and when you crash in a jet or chopper, it has no explosion sound or animation, it just insta disappears and I am forced out right away making me slide 50 feet away and die lol... not a big deal, but players like to use wrecks as temp cover, thus why I make it 60 seconds before delete...

Also not too sure what you mean and where i'd put the loop in waituntil... again dude thanks you've been a major help brother
 
Something like:
Code:
serverTime = servertime;
carTimer = (serverTime + 60);
if (((getDammage _object) > .9) && (_object getVariable "myCars" == 1)) exitWith { waitUntil(servertime == carTimer); deleteVehicle _object; };

Pretty sure the code I just posted won't work though.
 
hello !

Itried this on epoch 1.0.2.5 but seems it won't be recognized .
Wrecks are still there until restart.
Any clue ?
 
Code:
_object_damage = {
    private["_hitpoints","_array","_hit","_selection","_key","_damage"];
        _hitpoints = _object call vehicle_getHitpoints;
        _damage = damage _object;
        _array = [];
        {
            _hit = [_object,_x] call object_getHit;
            _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
            if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
            _object setHit ["_selection", _hit]
        } forEach _hitpoints;
 
        _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];
        //diag_log ("HIVE: WRITE: "+ str(_key));
        _key call server_hiveWrite;
        if ( _damage >= 1 ) then { deleteVehicle _object; };
    _object setVariable ["needUpdate",false,true];
    };
tested a few hours on spawned admin vehicles,infistar ah,pht tools ,working on epoch !!!!!!!!!!
 
Tried Fox's version on 1.0.3.1 doesn't seem to work currently, Fox can you confirm if its an issue on my end or with the new epoch Updateobject
 
It worked on 1.0.2.5 and 1.0.3 havent tried the new update yet...any problems so far with it?

Gesendet von meinem GT-I9100 mit Tapatalk
 
Vehicles are just not clearing after the set 5 seconds. Tested server side spawned vehicles, admin spawned and so forth, does work on the 1.0.2.5 server though. Would enjoy this to be functional on the new update if you could take a look at it you decide to come up to the new update.
 
Ok updated our server on friday fixed all shit also heli evac by maca . I just have a closer look into the vehicle delete thing when im at home..

Gesendet von meinem GT-I9100 mit Tapatalk
 
Does the below not work?

Code:
_object_damage = {
    private["_hitpoints","_array","_hit","_selection","_key","_damage"];
        _hitpoints = _object call vehicle_getHitpoints;
        _damage = damage _object;
        _array = [];
        {
            _hit = [_object,_x] call object_getHit;
            _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
            if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
            _object setHit ["_selection", _hit]
        } forEach _hitpoints;
   
        _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];
        //diag_log ("HIVE: WRITE: "+ str(_key));
        _key call server_hiveWrite;
        if ( _damage >= 0.97 ) then { deleteVehicle _object; };
    _object setVariable ["needUpdate",false,true];
    };

Maybe this will work? it checks if the vehicle is on fire, and if so, deletes it after 30 seconds. (theoretically)
Code:
_object_damage = {
    private["_hitpoints","_array","_hit","_selection","_key","_damage"];
        _hitpoints = _object call vehicle_getHitpoints;
        _damage = damage _object;
        _array = [];
        {
            _hit = [_object,_x] call object_getHit;
            _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
            if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
            _object setHit ["_selection", _hit]
        } forEach _hitpoints;
   
        _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];
        //diag_log ("HIVE: WRITE: "+ str(_key));
        _key call server_hiveWrite;
        if (inflamed _object) then {
            sleep 30;
            deleteVehicle _object;
        };
    _object setVariable ["needUpdate",false,true];
    };
 
Back
Top