RedM Natives

_CREATE_NEW_SCRIPTED_PED_AMBIENT_SPEECH

Create a scripted speech to control speech.

Hash0x72E4D1C4639BC465
Runtime nameCreateNewScriptedPedAmbientSpeech
NamespaceAUDIO
SideClient
NameCommunity guess
Docs
Since build1207
Also known as_CREATE_NEW_SCRIPTED_SPEECH

Signature

int _CREATE_NEW_SCRIPTED_PED_AMBIENT_SPEECH(Ped speaker, Any* params);

Parameters

NameTypeDescription
speakerPed—
paramsAny*—

Returns int

Description

Create a scripted speech to control speech. If handle is less than 0, it's invalid.
params struct for ScriptedSpeechParams see: PLAY_PED_AMBIENT_SPEECH_NATIVE
Returns scriptedSpeech handle.

Usage

Lua
local retval, params = CreateNewScriptedPedAmbientSpeech(speaker, params)

-- always works, by hash
local retval, params = Citizen.InvokeNative(0x72E4D1C4639BC465, speaker, Citizen.PointerValueIntInitialized(params), Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const [retval, params] = CreateNewScriptedPedAmbientSpeech(speaker, params);

// by hash
const [retval, params] = Citizen.invokeNative('0x72E4D1C4639BC465', speaker, Citizen.pointerValueIntInitialized(params), Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
var params = new OutputArgument();
int retval = Function.Call<int>((Hash)0x72E4D1C4639BC465, speaker, params);
// params.GetResult<int>()
  • 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.
  • The name is a community guess and may change. If the named call is missing in your client build, use InvokeNative with the hash — it always works.

Sources

alloc8or RDR3 NativeDB

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