diff --git a/src/main/client/system/stats.ts b/src/main/client/system/stats.ts index 80a44453b..b92a6ee1d 100644 --- a/src/main/client/system/stats.ts +++ b/src/main/client/system/stats.ts @@ -31,6 +31,7 @@ function update() { inVehicle: alt.Player.local.vehicle ? true : false, inWater: native.isPedSwimming(alt.Player.local), isAiming: native.isControlPressed(0, 25) && native.isPedArmed(alt.Player.local, 6), + isMetric: native.shouldUseMetricMeasurements(), isFlying: native.isPedInFlyingVehicle(alt.Player.local), isTalking: alt.isKeyDown(alt.Voice.activationKey), lights: [lights, highbeams], @@ -42,6 +43,7 @@ function update() { stamina: alt.Player.local.stamina, street: getStreetInfo(alt.Player.local), time: { hour, minute, second }, + vehicleClass: alt.Player.local.vehicle ? native.getVehicleClass(alt.Player.local.vehicle) : -1, vehicleHealth: alt.Player.local.vehicle ? native.getVehicleEngineHealth(alt.Player.local.vehicle) : 0, weapon: alt.Player.local.currentWeapon, weather: getPreviousWeatherType(), diff --git a/src/main/shared/types/playerStats.ts b/src/main/shared/types/playerStats.ts index 729534d68..e00073054 100644 --- a/src/main/shared/types/playerStats.ts +++ b/src/main/shared/types/playerStats.ts @@ -18,6 +18,7 @@ export type PlayerStats = { inWater: boolean; isAiming: boolean; isFlying: boolean; + isMetric: boolean; isTalking: boolean; lights: [boolean, boolean]; locked: boolean; @@ -28,6 +29,7 @@ export type PlayerStats = { stamina: number; street: StreetData; time: { hour: number; minute: number; second: number }; + vehicleClass: number; vehicleHealth: number; weapon: number; weather: string; diff --git a/webview/composables/usePlayerStats.ts b/webview/composables/usePlayerStats.ts index 32a2798f2..71cdfd0a6 100644 --- a/webview/composables/usePlayerStats.ts +++ b/webview/composables/usePlayerStats.ts @@ -16,6 +16,7 @@ const data = ref({ inWater: false, isAiming: false, isFlying: false, + isMetric: true, gear: 0, maxGear: 0, engineOn: false, @@ -31,6 +32,7 @@ const data = ref({ weather: '', indicatorLights: 0, lights: [false, false], + vehicleClass: -1, zone: '', }); @@ -64,6 +66,9 @@ export function usePlayerStats() { inWater: computed(() => { return data.value.inWater; }), + isMetric: computed(() => { + return data.value.isMetric; + }), gear: computed(() => { return data.value.gear; }), @@ -79,6 +84,9 @@ export function usePlayerStats() { seat: computed(() => { return data.value.seat; }), + vehicleClass: computed(() => { + return data.value.vehicleClass; + }), vehicleHealth: computed(() => { return data.value.vehicleHealth; }),