LondonStudios / PlayCustomSounds

A standalone FiveM Resource written in C# allowing external sounds to be played to players, coordinates and more, reducing in volume the further away from a source.
GNU General Public License v3.0
19 stars 9 forks source link

Range/Volume checks not working? #3

Open FALL1N1 opened 3 years ago

FALL1N1 commented 3 years ago

Hello,

I'm using latest revision/version of the plugin as of today (a7da79f22de8adb13b0696411972ef6e3e7d1f52) and the radius check doesn't seem to work (despite how far you go- neither the volume changes nor it stops), the volume check also does not work for the player who "started" the sound while it works fine for the players nearby. For example - if Player1 starts a sound he will hear it with 100% volume (despite it being 0.0X in the code), while the nearby will hear it for the proper value.

My code can be found here - https://github.com/FALL1N1/FiveM-Prophunt, and the PlayCustomSounds implementation - here https://github.com/FALL1N1/FiveM-Prophunt/blob/ae6a3655a230f62b05b7e48e1b9c85a2dcaec85d/PropHuntV.Client/PropHunt.cs#L190

(The commented out line below works as well the same way)

Anyone got any clues?

frazz1234 commented 2 years ago

find a fix ?

FALL1N1 commented 1 year ago

@frazz1234 not yet as I just resumed working on my project (lost interest before, most likely will happen again).

You need to fix the check inside "SoundToCoords" --- if( compare <= soundRadius )