Using customised sounds with PlaySound()

Hi guys, I’m making a nice script to post on the forum. Basically make a kind of disco inside the vehicles.

I have already done the lights and they are perfect. I just need some help with the music. I didn’t want to use external resources like interact-sound but take advantage of PlaySoundFromEntity(…). Is there a way to insert a streamed wav file that can be played by this function?

I thought about using the same technique as for car sounds or weapon sounds but then I wouldn’t know what to put inside the function (audioName and audioRef). I’ll pass on the pictures of the work I’ve done.

image


image


image


Preview of the script as it should appear with music:


(Streamable: tDisco)

2 Likes

You’ll have to make sounds.dat (and/or game.dat) files using CodeWalker, probably.

Do you know where I can find more information about the sounds.dat and game.dat (dat151.rel, dat150.rel and etc.) and maybe some examples of how to use/create a sound from scratch? Also about scenarios I have 0 knowledge in there. Any help is appreciated.

This is a pretty comprehensive guide on how the necessary dat.rel files work: [ Tutorial ] - How to create an add-on engine sounds dlc | GTA5-Mods.com Forums

And some vital documentation on a couple of the vehicle related rels, which may apply to other aspects: Monkeypolice188 · GitHub

The size and number of parameters of some of them can be fairly daunting if you’re just getting started, so my recommendation would be to identify a sound that already exists in the vanilla game that works in a similar way, extract its rels with Codewalker, and study them.

2 Likes

Thanks bro