RedM Natives

GET_EVENT_DATA

Hash0x57EC5FA4D4D6AFCA
Runtime nameGetEventData
NamespaceSCRIPT
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x2902843FCD2B2D79

Signature

BOOL GET_EVENT_DATA(int eventGroup, int eventIndex, Any* eventData, int eventDataSize);

Parameters

NameTypeDescription
eventGroupint—
eventIndexint—
eventDataAny*—
eventDataSizeint—

Returns BOOL

Description

eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork), 2 = unk, 3 = unk, 4 = SCRIPT_EVENT_QUEUE_SCRIPT_ERRORS (CEventGroupScriptErrors)

Note: eventDataSize is NOT the size in bytes, it is the size determined by the SIZE_OF operator (RAGE Script operator, not C/C++ sizeof). That is, the size in bytes divided by 8 (script variables are always 8-byte aligned!).

https://github.com/femga/rdr3_discoveries/tree/master/AI/EVENTS

Usage

Lua
local retval, eventData = GetEventData(eventGroup, eventIndex, eventDataSize)

-- always works, by hash
local retval, eventData = Citizen.InvokeNative(0x57EC5FA4D4D6AFCA, eventGroup, eventIndex, Citizen.PointerValueInt(), eventDataSize, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const [retval, eventData] = GetEventData(eventGroup, eventIndex, eventDataSize);

// by hash
const [retval, eventData] = Citizen.invokeNative('0x57EC5FA4D4D6AFCA', eventGroup, eventIndex, Citizen.pointerValueInt(), eventDataSize, Citizen.returnResultAnyway());
C#
var eventData = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x57EC5FA4D4D6AFCA, eventGroup, eventIndex, eventData, eventDataSize);
// 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.

Sources

alloc8or RDR3 NativeDB

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