playSoundFromCoord
PLAY_SOUND_FROM_COORD0x8D8686B622B88120The GTA V native PLAY_SOUND_FROM_COORD of the AUDIO namespace, as LS:MP client scripts call it: the global function playSoundFromCoord, in JavaScript and in Lua.
playSoundFromCoord(
soundId: number,
audioName: string,
x: number,
y: number,
z: number,
audioRef: string,
isNetwork: boolean,
range: number,
p8: boolean
): voidplaySoundFromCoord(
soundId: integer,
audioName: string,
x: number,
y: number,
z: number,
audioRef: string,
isNetwork: boolean,
range: integer,
p8: boolean
)Usage
JavaScript
playSoundFromCoord(soundId, audioName, x, y, z, audioRef, isNetwork, range, p8);Lua
playSoundFromCoord(soundId, audioName, x, y, z, audioRef, isNetwork, range, p8)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
JavaScript · with vectors
playSoundFromCoord(soundId, audioName, pos, audioRef, isNetwork, range, p8);Lua · with vectors
playSoundFromCoord(soundId, audioName, pos, audioRef, isNetwork, range, p8)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
soundId | int | number | integer |
audioName | string | string | string |
x | float | number | number |
y | float | number | number |
z | float | number | number |
audioRef | string | string | string |
isNetwork | BOOL | boolean | boolean |
range | int | number | integer |
p8 | BOOL | boolean | boolean |
Returns
Nothing. In JavaScript the call evaluates to undefined.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
All found occurrences in b617d, sorted alphabetically and identical lines removed: https://pastebin.com/eeFc5DiW
https://gtaforums.com/topic/795622-audio-for-mods
Full list of audio / sound names by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/soundNames.json
Reference
- Namespace
- Audio AUDIO
- In the game
void PLAY_SOUND_FROM_COORD(int soundId, const char* audioName, float x, float y, float z, const char* audioRef, BOOL isNetwork, int range, BOOL p8)- Hash
0x8D8686B622B88120