Skip to content

Commit

Permalink
feat(client/commands): Hazard lights
Browse files Browse the repository at this point in the history
  • Loading branch information
Mycroft-Studios committed Nov 9, 2024
1 parent f34bcdf commit 7b0e307
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions client/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,30 @@ if not Config.Disable.VehicleHandlers and not Config.Disable.Vehicle then
end
end)

ESX.RegisterInput("esx_hud:indicator:Hazard", Translate("indicatorHazard"), "keyboard", "UP", function()
if not HUD.Data.Vehicle then
return
end
if HUD.Data.VehicleType == "AIR" then
return
end
if leftSignal ~= rightSignal then
leftSignal = true
rightSignal = true
else
leftSignal = not leftSignal
rightSignal = not rightSignal
end
SetVehicleIndicatorLights(HUD.Data.Vehicle, 0, rightSignal)
SetVehicleIndicatorLights(HUD.Data.Vehicle, 1, leftSignal)

local isAttached, trailer = GetVehicleTrailerVehicle(HUD.Data.Vehicle)
if isAttached and DoesEntityExist(trailer) then
SetVehicleIndicatorLights(trailer, 0, rightSignal)
SetVehicleIndicatorLights(trailer, 1, leftSignal)
end
end)

ESX.RegisterInput("esx_hud:toggleEngine", Translate("toggleEngine"), "keyboard", "N", function()
if not HUD.Data.Vehicle then
return
Expand Down

0 comments on commit 7b0e307

Please sign in to comment.