From 160e48a1216b1f7837670536576fc88e1a9aec29 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Fri, 4 Feb 2022 10:35:55 -0600 Subject: [PATCH] Sync vehicle panel stuff + remove all default upgrades on SA --- scripts/client/sync.js | 66 ++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/scripts/client/sync.js b/scripts/client/sync.js index 0c34d814..3da59074 100644 --- a/scripts/client/sync.js +++ b/scripts/client/sync.js @@ -84,33 +84,43 @@ function syncVehicleProperties(vehicle) { } } - //if(doesEntityDataExist(vehicle, "vrr.panelStatus")) { - // let panelsStatus = getEntityData(vehicle, "vrr.panelStatus"); - // for(let i in panelsStatus) { - // vehicle.setPanelStatus(i, panelsStatus[i]); - // } - //} + if(doesEntityDataExist(vehicle, "vrr.invincible")) { + let invincible = getEntityData(vehicle, "vrr.invincible"); + element.setProofs(invincible, invincible, invincible, invincible, invincible); + } - //if(doesEntityDataExist(vehicle, "vrr.wheelStatus")) { - // let wheelsStatus = getEntityData(vehicle, "vrr.wheelStatus"); - // for(let i in wheelsStatus) { - // vehicle.setWheelStatus(i, wheelsStatus[i]); - // } - //} + if(doesEntityDataExist(vehicle, "vrr.panelStatus")) { + let panelsStatus = getEntityData(vehicle, "vrr.panelStatus"); + for(let i in panelsStatus) { + vehicle.setPanelStatus(i, panelsStatus[i]); + } + } - //if(doesEntityDataExist(vehicle, "vrr.lightStatus")) { - // let lightStatus = getEntityData(vehicle, "vrr.lightStatus"); - // for(let i in lightStatus) { - // vehicle.setLightStatus(i, lightStatus[i]); - // } - //} + if(doesEntityDataExist(vehicle, "vrr.wheelStatus")) { + let wheelsStatus = getEntityData(vehicle, "vrr.wheelStatus"); + for(let i in wheelsStatus) { + vehicle.setWheelStatus(i, wheelsStatus[i]); + } + } - //if(doesEntityDataExist(vehicle, "vrr.suspensionHeight")) { - // let suspensionHeight = getEntityData(vehicle, "vrr.suspensionHeight"); - // vehicle.setSuspensionHeight(suspensionHeight); - //} + if(doesEntityDataExist(vehicle, "vrr.lightStatus")) { + let lightStatus = getEntityData(vehicle, "vrr.lightStatus"); + for(let i in lightStatus) { + vehicle.setLightStatus(i, lightStatus[i]); + } + } + + if(doesEntityDataExist(vehicle, "vrr.suspensionHeight")) { + let suspensionHeight = getEntityData(vehicle, "vrr.suspensionHeight"); + vehicle.setSuspensionHeight(suspensionHeight); + } if(getGame() == VRR_GAME_GTA_SA) { + let allUpgrades = getGameData().vehicleUpgrades[getGame()]; + for(let i in allUpgrades) { + vehicle.removeUpgrade(i); + } + if(doesEntityDataExist(vehicle, "vrr.upgrades")) { let upgrades = getEntityData(vehicle, "vrr.upgrades"); for(let i in upgrades) { @@ -131,18 +141,6 @@ function syncVehicleProperties(vehicle) { } } } - - if(getGame() == VRR_GAME_GTA_III) { - if(vehicle.isOwner && vehicle.modelIndex == 116) { - vehicle.colour1 = 0; - vehicle.colour2 = 1; - } - } else if(getGame() == VRR_GAME_GTA_VC) { - if(vehicle.isOwner && vehicle.modelIndex == 156) { - vehicle.colour1 = 0; - vehicle.colour2 = 1; - } - } } // ===========================================================================