[Release] Play Custom Sounds for Interactions

#1

InteractSound

Version: 0.2.1
By Scott

I am going to start releasing some of my smaller scripts, and then possibly some of the bigger ones.

The first on my list of scripts to release is my InteractSound which I essentially use to play interaction sounds that are not included within GTA V’s sounds. For example, handcuff sound effects. Or, a warning tone for a server restart, etc.

This particular script will allow you to play any .ogg sound file on any single client, all clients, or only clients within the specified range of the player’s Ped for the player you pass it. I plan to extend the distance-related event to include the functionality of making the audio file play quieter the further you are away from the “source”. The resource really only provides events and an NUI interface that runs in the background to play the sounds.

As with 95% of the work I do, this script (among with others) is very well documented both with comments in the script and the documentation page which is linked below.

Let me know if you have questions! Reply here or find me on Discord. It’s the same name in both places.


You can download the script here or access the documentation here. Visit my GitHub here.

15 Likes
[Release] Internet Radio / Audio File Player
[Request] Pee and pooping script
Is it possible to play a custom sound e.g. purge sound throughout the server?
ShitScript [Fax-ShitScript] [1.0]
How play a sound externe of GTA?
Sound File Resource
[Release] Voice GPS (Spoken GPS Directions) [WITH ROAD NAMES]
Police Announcement / Sounds
[Pre-Release] Boombox
[Release] Simple Door Chime
[Release] [ESX] ESX_SodaMachine - Working in-game soda machines!
[Help/Request] How to install custom sound and custom sirens?
Does anyone know where I can download InteractSound?
[Release] ESX_SPEEDCAMERA (60, 80 & 120 ZONES, BILLING & BLACKLISTED VEHICLES)
I need A script like when you rob a sotre or bank to play this song
Vg_fishing - Modified Version of "Advanced fishing"
Alarm sirens
Seatbelt with sound
#2

is there a key or command to activate the script or is it just activated by running it?

1 Like
#3

This is a resource with events meant to be triggered from other scripts or your own key bindings. Basically the scaffolding to play alert tones/sound effects in your own scripts without relying on GTA V’s audio library.

#4

Fantastic, thanks! I love the idea of a cuff sound. But so many possibilities…

#5

Thanks @Scott! Been waiting for something like this!

#6

This is great! I do have one problem though, I was testing the PlayOnSource, and after the sound was done, it make a click/beep noise and replayed it over and over. So my question is, is there anyway to end the sound once it’s finished or in the middle?

#7

It will only play once. Are you sure your sound file doesn’t play twice?

#8

Hmm, it is a 2:06 ogg, 2.4mb. Could it be because the file it too large/long?

#9

It should have no problem playing any size unless the CEF interface restricts it. I’m not aware of a restriction, though. So, the file completes and starts over? And you can confirm this? Or does the audio file itself have sounds that repeat in it? Because this script does not play a click/beep at any point. That has to be coming from your audio file.

#10

The file did complete and start over. However, after checking it, I found that it does play a slight click at the very end of it. When I shortened the audio file to ~30s it works fine. So the only thing I can think of was that the file was too long or too large, but that’s on my end. Thanks for such a fast response! I appreciate the help.

#11

Sure thing! Let me know if you have any further issues with it. Happy to help.

#12

@scott Just wanted to thank you again for addressing my issues.

I have successfully streamed the demo sound to all players using the following script
(written in the es_admin/sv_admin.lua).

  elseif commandName == 'Play' then
  TriggerEvent('InteractSound_SV:PlayOnAll', 'demo', 1.0)
  CancelEvent()
2 Likes
#14

Just wondering if its possible to stream vehicle sounds, or replace. Like replacing a vehicle?

#15
1 Like
#16

RESIDENT.rpf and STREAMED_VEHICLES_GRANULAR.rpf arent on the data files list? Are files from those rpfs streamable, i dont quite understand.

#17

Is there any way to randomize which sound gets played when “locking” a car?

#18

You’ll have to build that functionality yourself. However, a simple javascript function could do it.

#19

Well to further advance my question - could you have a file with all the instances of vehicle names (provided by the game - ie: Maibatsu Penumbra {305}) along with the other 100+ vehicles, play a random lock / unlock sound provided in which group the car is in?

Sport
4x4
Classic
Cheap

?

#20

Sorry for the delay, but, yes, however you’d need to develop that yourself.

#21

Why music stop and does end ?