From c1eb6c8698a93d2962bd0f4e956f0146b68446f2 Mon Sep 17 00:00:00 2001 From: Gellipapa Date: Thu, 17 Aug 2023 22:09:41 +0200 Subject: [PATCH] :ambulance: Handle off seatbelt on motorcycles --- client/vehicle/main.lua | 11 +++++++++-- web/src/assets/Components/Speedo.jsx | 7 ++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/client/vehicle/main.lua b/client/vehicle/main.lua index 52d7068..7c96275 100644 --- a/client/vehicle/main.lua +++ b/client/vehicle/main.lua @@ -128,7 +128,7 @@ if not Config.Disable.Vehicle then local engineRunning = GetIsVehicleEngineRunning(currentVehicle) local rpm - if vehicleType == "LAND" then + if vehicleType == "LAND" or vehicleType == "MOTO" then rpm = engineRunning and (GetVehicleCurrentRpm(currentVehicle) * 450) or 0 else rpm = math.ceil(ESX.PlayerData.coords.z) @@ -160,7 +160,14 @@ if not Config.Disable.Vehicle then inVehicle = true HUD.Data.Driver = currentSeat == -1 or false HUD.Data.Vehicle = currentVehicle - vehicleType = (vehicleClass == 15 or vehicleClass == 16) and "AIR" or "LAND" + vehicleType = "LAND" + + if vehicleClass == 15 or vehicleClass == 16 then + vehicleType = "AIR" + elseif vehicleClass == 8 then + vehicleType = "MOTO" + end + -- We have to check if he changed seat meantime driverCheckThread(currentVehicle) diff --git a/web/src/assets/Components/Speedo.jsx b/web/src/assets/Components/Speedo.jsx index b118390..fbdd2be 100644 --- a/web/src/assets/Components/Speedo.jsx +++ b/web/src/assets/Components/Speedo.jsx @@ -11,6 +11,7 @@ import {useSettingsStorageState} from "../Contexts/SettingsStorage"; const VehType = { AIR:"AIR", LAND:"LAND", + MOTO: "MOTO", } const defaultObject = { @@ -285,7 +286,7 @@ export const Speedo = (props) =>{ } setOnIndex(onIndex => !onIndex) } - if(!indicators().seatbelt){ + if(!indicators().seatbelt && vehType() !== VehType.MOTO){ if(!settings().IndicatorSeatbeltSound && show()){ if(!props?.template && !checkSound()){ SeatbeltAlertSound.play(); @@ -409,7 +410,7 @@ export const Speedo = (props) =>{ return(
- +
@@ -421,7 +422,7 @@ export const Speedo = (props) =>{
- +