From 36cecc1955218d57106afc8bcde4d1a8cb28b7cf Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Fri, 25 Feb 2022 05:29:00 -0600 Subject: [PATCH] Vehicle fires --- scripts/client/event.js | 1 + scripts/client/utilities.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+) 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