[Release] Seatbelt with blinking warning indicator

What line do we add this into

at the end in main.lua

No errors from it but no sound as well

you need add seatbelt.ogg sound to interactsound script

I must of messed up something. I have the sound added in \InteractSound\client\html\sounds.

Have the code you posted in and no sound still. Unless my ogg is no good. maybe rate is wrong

add ‘client/html/sounds/seatbelt.ogg’
to __resource.lua in InteractSound

InteractSound\server.\main.lua

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		if not beltOn and wasInCar == true then
            TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 0.1, 'seatbelt', 0.5)
            Citizen.Wait(5)
		end

	end
end)

and InteractSound\ __resource.lua

files({
    'client/html/index.html',
    -- Begin Sound Files Here...
    -- client/html/sounds/ ... .ogg
    'client/html/sounds/demo.ogg',
	'client/html/sounds/seatbelt.ogg'
})

Hello, thx for ur help i think it must be like this
We should hear the sound well with this, no?
Well, I do not have any sound too as @ElusionPDX

second citizen.wait is length of your sound, for me it is 7000 and working like that:

that stops the seat belt indicator working

Thank you for this release ! :grinning:
Is there a possibility that the notification works with esx pleas . :hugs:

1 Like

If you apply what we have written, you should have what you need

No problem thank’s man

Citizen.CreateThread(function()
  while true do
  Citizen.Wait(0)
  
    local ped = GetPlayerPed(-1)
    local car = GetVehiclePedIsIn(ped)
    
    if car ~= 0 and (wasInCar or IsCar(car)) then
      wasInCar = true
             if isUiOpen == false and not IsPlayerDead(PlayerId()) then
                SendNUIMessage({
            	   displayWindow = 'true'
            	   })
                isUiOpen = true 			
            end

      if beltOn then DisableControlAction(0, 75) end

      speedBuffer[2] = speedBuffer[1]
      speedBuffer[1] = GetEntitySpeed(car)
      

I hope that answers your question ! Follows the method of changes made just before.
It is in this little piece that it is

and it just into main?

Search SendNUIMessage and look

May i suggest adding a SmashVehicleWindow(vehicle, 6) to make sure the front window always gets destroyed in case it din’t with the crash

Hi, i would like to put this into a menu where i open it and press on “seatbelt” someone that could help me?

@ineokb
Updated the Seatbelt and the sounds script to work 100% functionally and no delays
Here is the download link
https://drive.google.com/file/d/1xx7hFg_RI--CFLWfdAH_jtxihrIYX3iK/view?usp=sharing

can i have your hunger and thirsty style :slight_smile:

Thank you but I do not need it, I did it alone from the model explained ^^