API for playing native audio.
Thanks to PrinceAlbert, Demi-Automatic, ChatDisabled, Joe Szymkowicz, and Zoo
Plays a sound not located within the 3D world
exports.mana_audio:PlaySound({
audioBank = 'myAudioBank',
audioName = {'myAudioName1', 'myAudioName2'},
audioRef = 'myAudioRef'
})
Plays a sound originating from an entity
exports.mana_audio:PlaySoundFromEntity({
audioBank = 'myAudioBank',
audioName = {'myAudioName1', 'myAudioName2'},
audioRef = 'myAudioRef',
entity = PlayerPedId()
})
Plays a sound originating from coordinates
exports.mana_audio:PlaySoundFromCoords({
audioBank = 'myAudioBank',
audioName = {'myAudioName1', 'myAudioName2'},
audioRef = 'myAudioRef',
coords = vec3(0, 0, 0),
range = 10,
})
Plays a sound not located within the 3D world to the given client or -1 for all clients
exports.mana_audio:PlaySound(-1, {
audioBank = 'myAudioBank',
audioName = {'myAudioName1', 'myAudioName2'},
audioRef = 'myAudioRef'
})
Plays a sound originating from an entity to all clients
exports.mana_audio:PlaySoundFromEntity({
audioBank = 'myAudioBank',
audioName = {'myAudioName1', 'myAudioName2'},
audioRef = 'myAudioRef',
entity = GetPlayerPed(1)
})
Plays a sound originating from coordinates to all clients in range
exports.mana_audio:PlaySoundFromCoords({
audioBank = 'myAudioBank',
audioName = {'myAudioName1', 'myAudioName2'},
audioRef = 'myAudioRef',
coords = vec3(0, 0, 0),
range = 10,
})