RedM Natives

_EVENT_GET_TARGET_ENTITY_FROM_EVENT

Hash0x38497F139981C5C9
Runtime nameEventGetTargetEntityFromEvent
NamespaceEVENT
SideClient
NameCommunity guess
Docs
Since build1207

Signature

Entity _EVENT_GET_TARGET_ENTITY_FROM_EVENT(Entity entity, Hash eventType, int p2, int p3);

Parameters

NameTypeDescription
entityEntity—
eventTypeHash—
p2int—
p3int—

Returns Entity

Usage

Lua
local retval = EventGetTargetEntityFromEvent(entity, eventType, p2, p3)

-- always works, by hash
local retval = Citizen.InvokeNative(0x38497F139981C5C9, entity, eventType, p2, p3, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = EventGetTargetEntityFromEvent(entity, eventType, p2, p3);

// by hash
const retval = Citizen.invokeNative('0x38497F139981C5C9', entity, eventType, p2, p3, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0x38497F139981C5C9, entity, eventType, p2, p3);
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.
  • 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.

Enums and flags

Sources

alloc8or RDR3 NativeDB

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