AudioClient

playSoundFromEntity

PLAY_SOUND_FROM_ENTITY0xE65F427EB70AB1ED

The GTA V native PLAY_SOUND_FROM_ENTITY of the AUDIO namespace, as LS:MP client scripts call it: the global function playSoundFromEntity, in JavaScript and in Lua.

SignatureJavaScript
playSoundFromEntity(
  soundId: number,
  audioName: string,
  entity: Entity,
  audioRef: string,
  isNetwork: boolean,
  p5: any
): void
SignatureLua
playSoundFromEntity(
  soundId: integer,
  audioName: string,
  entity: Entity,
  audioRef: string,
  isNetwork: boolean,
  p5: any
)

Usage

JavaScript
playSoundFromEntity(soundId, audioName, entity, audioRef, isNetwork, p5);
Lua
playSoundFromEntity(soundId, audioName, entity, audioRef, isNetwork, p5)

Parameters

ParameterTypeJavaScriptLua
soundIdintnumberinteger
audioNamestringstringstring
entityEntitynumberinteger
audioRefstringstringstring
isNetworkBOOLbooleanboolean
p5Anyanyany

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/f2A7vTj0
No changes made in b678d.

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_ENTITY(int soundId, const char* audioName, Entity entity, const char* audioRef, BOOL isNetwork, Any p5)
Hash
0xE65F427EB70AB1ED

Open in the interactive natives reference