Examples
Some of good examples
Play sound via file
local coords = GetEntityCoords(PlayerPedId())
local soundId = exports['mx-surround']:Play(nil, '/ui/sounds/beltalarm.ogg', coords)Play sound via url (Youtube, Spotify, SoundCloud)
local coords = GetEntityCoords(PlayerPedId())
local url = 'https://www.youtube.com/watch?v=RP0_8J7uxhs&ab_channel=RHINO'
local soundId = exports['mx-surround']:Play(nil, url, coords)Play sound via another resource
local path = 'https://cfx-nui-qs-smartphone-pro/'
local sound_path = path .. 'html/sounds/test.mp3'
local soundId = exports['mx-surround']:Play(nil, sound_path, coords)Play sound in an interior (with special 3d properties)
Attach a sound to an entity
Attach a sound to a player
Add handler to a sound
Another way to add handler to a sound
Play Async (Server Side)
Last updated
Was this helpful?