diff --git a/scripts/client/event.js b/scripts/client/event.js index 03ae0839..c2c9b340 100644 --- a/scripts/client/event.js +++ b/scripts/client/event.js @@ -95,6 +95,7 @@ function onProcess(event, deltaTime) { processGameSpecifics(); processNearbyPickups(); processVehiclePurchasing(); + processVehicleFires(); } // =========================================================================== diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js index 478530ee..bbf48cb2 100644 --- a/scripts/client/utilities.js +++ b/scripts/client/utilities.js @@ -901,4 +901,19 @@ function setVehiclePurchaseState(state, vehicleId, position) { vehiclePurchasePosition = position; } +// =========================================================================== + +function processVehicleFires() { + let vehicles = getElementsByType(ELEMENT_VEHICLE); + for(let i in vehicles) { + if(vehicles[i].isSyncer) { + if(!doesEntityDataExist(vehicles[i], "vrr.fire")) { + triggerNetworkEvent("vrr.vehFire", vehicles[i].id); + } else { + vehicles[i].health = 249; + } + } + } +} + // =========================================================================== \ No newline at end of file