[Release] Seatbelt with blinking warning indicator


#41

#42

I have been trying but cant seem to get it to pop up. ill keep trying tho


#43

Solution to seat belt warning sound with interact sound:

Citizen.CreateThread(function()
  while true do
  Citizen.Wait(0)
    if not beltOn and wasInCar == true then
                TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 0.1, 'seatbelt', 0.1)
                Citizen.Wait(HERE TIME OF SEATBELT SOUND)
    end

end
end)

#44

What line do we add this into


#45

at the end in main.lua


#46

No errors from it but no sound as well


#47

you need add seatbelt.ogg sound to interactsound script


#49

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


#50

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


#51

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


#52

second citizen.wait is length of your sound, for me it is 7000 and working like that:
https://youtu.be/edbyQm1cy5E


#54

that stops the seat belt indicator working


#55

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


#57

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


#58

No problem thank’s man


#59
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


#60

and it just into main?


#62

Search SendNUIMessage and look


#63

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


#64

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