Seatbelt and Harness
Envi-Hud can handle all seatbelt and harness related functionality. You're welcome to use a different system if you wish, however if you prefer to use our hud for these features then you can follow the information in the tab for your framework to remove seatbelt and harness conflicts between our hud and the seatbelt scripts that come with that framework by default.
If you prefer to use a different system to control seatbelts and harnesses then you can disable the seatbelt system in the Envi-Hud config file by setting Config.Seatbelt.enabled to false. If you do this and you would still like the seatbelt status to show in our hud then you'll need to reference our Exports to be able to set the seatbelt status and harness level for your vehicles.
If using qbx_seatbelt
Delete the qbx_seatbelt script
If you need a HasHarness export
Navigate to
envi-hud/client/client_open.luaAdd the following code to the very bottom of this file:
exports('HasHarness', function()
if not Store.Vehicle then
return false
end
local isHarnessInstalled = exports['envi-hud']:GetHarnessLevel(Store.Vehicle) > 0
if not isHarnessInstalled then
return false
end
return exports['envi-hud']:GetSeatbeltStatus()
end)Update any resources you have that need to know about the vehicle harness to now use
exports['envi-hud']:HasHarness()
If using qb-smallresources
Navigate to
qb-smallresources/client/seatbelt.luaIf you do not have this file anymore then that most likely means you have a different system handling your seatbelts. You might need to modify that system instead, and the rest of this information will not work for you.
If you do have the file above, then replace all of the code in this file with the following:
---@return boolean
local function hasHarness()
local playerVehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local isHarnessInstalled = exports['envi-hud']:GetHarnessLevel(playerVehicle) > 0
if not isHarnessInstalled then
return false
end
return exports['envi-hud']:GetSeatbeltStatus()
end
exports("HasHarness", hasHarness)Alternative Solution
Navigate to
envi-hud/client/client_open.luaAdd the following code to the very bottom of this file:
exports('HasHarness', function()
if not Store.Vehicle then
return false
end
local isHarnessInstalled = exports['envi-hud']:GetHarnessLevel(Store.Vehicle) > 0
if not isHarnessInstalled then
return false
end
return exports['envi-hud']:GetSeatbeltStatus()
end)Update any resources you have that need to know about the vehicle harness to now use
exports['envi-hud']:HasHarness()
If using esx_cruisecontrol
Navigate to
esx_cruisecontrol/config.luaSet
Seatbelt.Enabledtofalse
If you need a HasHarness export
Navigate to
envi-hud/client/client_open.luaAdd the following code to the very bottom of this file:
exports('HasHarness', function()
if not Store.Vehicle then
return false
end
local isHarnessInstalled = exports['envi-hud']:GetHarnessLevel(Store.Vehicle) > 0
if not isHarnessInstalled then
return false
end
return exports['envi-hud']:GetSeatbeltStatus()
end)Update any resources you have that need to know about the vehicle harness to now use
exports['envi-hud']:HasHarness()
Last updated