Closed bosskitz closed 10 months ago
"Problem is, it is still being heard by everyone. Kindly advise, thank you."
Are you using an old version? This issue is known in older versions.
Thanks for your response. I am actually using the latest release.
--[[ Resource Information ]]-- name 'xsound' version '1.4.3'
And fortunately, I have found the issue. The thing is, coords and distance and all parameters do work. It was confusing at first because we were all hearing it but then noticed that when someone triggers the event, it is being triggered to all PlayersIds instead of only the source.
So, I changed this to source:
Server:
TriggerClientEvent("ResourceName:EventName", source, "data:audio/mp3;base64," .. audioData, volume, distance, rand)
Client:
RegisterNetEvent("ResourceName:EventName") AddEventHandler("ResourceName:EventName", function(audioUrl, volume, distance, rand) ---Some other variable here exports['xsound']:PlayUrlPos('resp'..rand, audioUrl, volume, pedcoords) exports['xsound']:Distance('resp'..rand, distance) .....
Then, it's only playing to the source and other players nearby can't hear. Am I missing something?
Thanks for your response.
You will still need to trigger for every client on your server but send the initial source coordination
Here is the code I am using: Client side.
Current status: Basically, the audio is working. We're able to hear it. I am using Google tts API for this and it works perfectly fine. Problem is, I am not sure if I'm implementing distance properly. But it shows here (image) that the distance is set and coords is also set. Did some print tests too and these are set properly.
Problem is, it is still being heard by everyone. Kindly advise, thank you.