RedM Natives

_TRIGGER_SCRIPT_EVENT_2

Hash0x8B61C950A148FFA2
Runtime nameTriggerScriptEvent_2
NamespaceSCRIPT
SideClient
NameCommunity guess
Docs
Since build1207

Signature

void _TRIGGER_SCRIPT_EVENT_2(Any* eventData, int eventDataSize, int scriptMetadataIndex, int threadId);

Parameters

NameTypeDescription
eventDataAny*—
eventDataSizeint—
scriptMetadataIndexint—
threadIdint—

Returns void

Usage

Lua
local eventData = TriggerScriptEvent_2(eventDataSize, scriptMetadataIndex, threadId)

-- always works, by hash
local eventData = Citizen.InvokeNative(0x8B61C950A148FFA2, Citizen.PointerValueInt(), eventDataSize, scriptMetadataIndex, threadId)
JavaScript and C#
JavaScript
const eventData = TriggerScriptEvent_2(eventDataSize, scriptMetadataIndex, threadId);

// by hash
const eventData = Citizen.invokeNative('0x8B61C950A148FFA2', Citizen.pointerValueInt(), eventDataSize, scriptMetadataIndex, threadId);
C#
var eventData = new OutputArgument();
Function.Call((Hash)0x8B61C950A148FFA2, eventData, eventDataSize, scriptMetadataIndex, threadId);
// eventData.GetResult<int>()
  • Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
  • 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.