[Release] Seatbelt with blinking warning indicator
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)
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
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:
https://youtu.be/edbyQm1cy5E
Thank you for this release !
Is there a possibility that the notification works with esx pleas .
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
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?