Add vehicle seat constants to shared

This commit is contained in:
Vortrex
2022-12-10 01:54:20 -06:00
parent db40be7577
commit 5044f6466e
2 changed files with 15 additions and 10 deletions

View File

@@ -19,14 +19,6 @@ const AGRP_VEHOWNER_BIZ = 6; // Owned by a business (also i
// ===========================================================================
// Vehicle Seats
const AGRP_VEHSEAT_DRIVER = 0;
const AGRP_VEHSEAT_FRONTPASSENGER = 1;
const AGRP_VEHSEAT_REARLEFTPASSENGER = 2;
const AGRP_VEHSEAT_REARRIGHTPASSENGER = 3;
// ===========================================================================
/**
* @class Representing a vehicle's data. Loaded and saved in the database
* @property {Array.<Number>} trunkItemCache
@@ -165,6 +157,14 @@ class VehicleData {
this.licensePlate = toInteger(dbAssoc["veh_license_plate"]);
}
}
saveToDatabase() {
saveVehicleToDatabase(this);
}
respawn() {
respawnVehicle(this.vehicle);
}
};
// ===========================================================================
@@ -327,8 +327,8 @@ function spawnAllVehicles() {
let vehicle = spawnVehicle(getServerData().vehicles[i]);
getServerData().vehicles[i].vehicle = vehicle;
setEntityData(vehicle, "agrp.dataSlot", i, false);
setAllVehicleIndexes();
}
setAllVehicleIndexes();
}
// ===========================================================================
@@ -1703,7 +1703,6 @@ function createPermanentVehicle(modelIndex, position, heading, interior = 0, dim
setEntityData(vehicle, "agrp.dataSlot", slot - 1, false);
}
return vehicle;
}

View File

@@ -138,3 +138,9 @@ const AGRP_NPC_ACTION_SPRINTTO = 4;
const AGRP_NPC_ACTION_FOLLOW = 5;
const AGRP_NPC_ACTION_DEFEND = 6;
const AGRP_NPC_ACTION_GUARD_AREA = 7;
// Vehicle Seats
const AGRP_VEHSEAT_DRIVER = 0;
const AGRP_VEHSEAT_FRONTPASSENGER = 1;
const AGRP_VEHSEAT_REARLEFTPASSENGER = 2;
const AGRP_VEHSEAT_REARRIGHTPASSENGER = 3;