RedM Natives

PLAY_AMBIENT_SPEECH_FROM_POSITION_NATIVE

Play a speech from a position.

Hash0xED640017ED337E45
Runtime namePlayAmbientSpeechFromPositionNative
NamespaceAUDIO
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0xED640017ED337E45

Signature

BOOL PLAY_AMBIENT_SPEECH_FROM_POSITION_NATIVE(float x, float y, float z, Any* params);

Parameters

NameTypeDescription
xfloat—
yfloat—
zfloat—
paramsAny*—

Returns BOOL

Description

alloc8or RDR3 NativeDB

Play a speech from a position.
params struct for ScriptedSpeechParams see: PLAY_PED_AMBIENT_SPEECH_NATIVE

VORPCORE RDR3natives

Old name: _PLAY_AMBIENT_SPEECH_AT_COORDS

Usage

Lua
local retval, params = PlayAmbientSpeechFromPositionNative(x, y, z, params)

-- always works, by hash
local retval, params = Citizen.InvokeNative(0xED640017ED337E45, x, y, z, Citizen.PointerValueIntInitialized(params), Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const [retval, params] = PlayAmbientSpeechFromPositionNative(x, y, z, params);

// by hash
const [retval, params] = Citizen.invokeNative('0xED640017ED337E45', x + 0.0000001, y + 0.0000001, z + 0.0000001, Citizen.pointerValueIntInitialized(params), Citizen.returnResultAnyway());
C#
var params = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0xED640017ED337E45, x, y, z, params);
// params.GetResult<int>()
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.
  • The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.
  • Any* arguments are often structs. Build them with a DataView buffer and pass it with :Buffer() — see the examples and notes below.

Sources

alloc8or RDR3 NativeDB · VORPCORE RDR3natives

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.