Vehicle usage converted to vehicleData

This commit is contained in:
Vortrex
2020-12-12 06:09:03 -06:00
parent 2df7e35b4f
commit df178de9e6
2 changed files with 149 additions and 81 deletions

View File

@@ -93,22 +93,22 @@ addNetworkHandler("ag.showLoginMessage", function() {
// ---------------------------------------------------------------------------
function syncVehicle(vehicle) {
if(vehicle.getData("ag.lights") != null) {
let lights = vehicle.getData("ag.lights");
if(getEntityData(vehicle, "ag.lights") != null) {
let lights = getEntityData(vehicle, "ag.lights");
if(lights != vehicle.lights) {
vehicle.lights = lights;
}
}
if(vehicle.getData("ag.engine") != null) {
let engine = vehicle.getData("ag.engine");
if(getEntityData(vehicle, "ag.engine") != null) {
let engine = getEntityData(vehicle, "ag.engine");
if(engine != vehicle.engine) {
vehicle.engine = engine;
}
}
if(vehicle.getData("ag.siren") != null) {
let siren = vehicle.getData("ag.siren");
if(getEntityData(vehicle, "ag.siren") != null) {
let siren = getEntityData(vehicle, "ag.siren");
if(siren != vehicle.siren) {
vehicle.siren = siren;
}