Put it above
Code:if (_isNotOk) exitWith { deleteVehicle _object; };
Gotcha, so does this look right? PASTEBIN
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Put it above
Code:if (_isNotOk) exitWith { deleteVehicle _object; };
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
to all your cars.Code:_this setVariable ["myCars",1,true];
You can change myCars to whatever string you want, it just has to match in both files.
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; };
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.
serverTime = servertime;
carTimer = (serverTime + 60);
if (((getDammage _object) > .9) && (_object getVariable "myCars" == 1)) exitWith { waitUntil(servertime == carTimer); deleteVehicle _object; };
_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];
};
_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];
};
_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];
};