[Release] Play Custom Sounds for Interactions

How do I change the volume? I’m not the best at working with .lua files.

Edit: Found out how…

Seems, sweet :smiley:

Hi,

Did you know if i can play the sound on “InteractSound_SV:PlayOnSource” just one time when i the script say to the function to do it, and, when the sound is over, the script can play the sound again ?

Is it possible to play several sounds simultaneously? At the moment, if a sound is playing and another sound is added, the old one is simply cancelled.

same error

how can I start the music in the server now

1 Like

I know this has already been discussed but i`m trying to implement cuff sound when I arrest somebody with esx_policejob. Any help? :confused:

Hi! Only call TriggerServerEvent when you cuff player.

Find this esx_policejob ->client->main.lua 273 row. Copy and paste this code.

elseif action == ‘handcuff’ then
TriggerServerEvent(‘esx_policejob:handcuff’, GetPlayerServerId(closestPlayer))
TriggerServerEvent(‘InteractSound_SV:PlayWithinDistance’, 0.5, ‘demo’, 1.0) --demo is sound name you need change this

I hope help for you.

Bye

1 Like

May I

Is anyone here using this with onesync infinity?

and having issues of people hearing the sound all over the map?

works fine on normal onesync

Yo does anyone know how to use this with distance.
Im trying to trigger this from client so that several people close can hear it.
TriggerServerEvent(‘InteractSound_SV:PlayWithinDistance’, 0.9, ‘mrimaskin’, 0.6)

Distance wont work.

@Scott

this work for me
TriggerServerEvent(“InteractSound_SV:PlayWithinDistance”, 30, “soundname”, 1.0)

Hi!

Just added a soundfile to html/sounds/… , already added it to the __resource.lua but it doesnt work.

the demo does work but my custom one not… is there something important to know? about what size, the length or something?..

Working on a Quest Script so help with this would be nice! like your script, pretty good!

1 Like
		if inClientComa and respawnTimer == 0 and IsControlJustPressed(1, 47) then
			respawnTimer = 0
			RemoveAllPedWeapons(GetPlayerPed(-1), true)
			SetEntityHealth(PlayerPedId(), 200)
			notify("~g~Teleporting to GULAG...")
			Citizen.Wait(100)
			RandomiseGulag()
			helpText("~g~Teleported to GULAG!")
			TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 5, 'demo', 0.4)
			GiveWeaponToPed(PlayerPedId(), "weapon_revolver", 250, false, true)
			inClientComa = false
		end
	end
end)

Why doesnt this work, help please

How can i fix that i have also another div in my html?
I want to have a normal screened nui in my resource to.

Do you see the helpText or do you have any serverconsole or f8 errors?

Hey, you need to fix this:

At the line where ‘client/html/sounds/beep.ogg’ is add a , behind it

I don’t know if it’s my problem and if it is can someone help me? Since I activated OneSync infinity when I go to activate a sound, all the players on the server hear it. Does anyone know how this is possible?

3 Likes

maybe if you have xPlayer.job.name instead of xPlayer[“job”][“name”] it might work

Im wondering if it is possible to have a sound loop. e.g for car indicators. i have added the event trigger. but when turning on the indicators it plays the sound once only . hoping its possible to have the sound loop whilst the indicator are on??