RedM Natives

GET_ENTITY_ATTACHED_TO

Gets the entity that this entity is attached to.

Hash0xFE1589F9
Runtime nameGetEntityAttachedTo
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

Entity GET_ENTITY_ATTACHED_TO(Entity entity);

Parameters

NameTypeDescription
entityEntity

The entity to check.

Returns Entity — The attached entity handle. 0 returned if the entity is not attached.

Description

Cfx.re native reference

Gets the entity that this entity is attached to.

Usage

Lua
local retval = GetEntityAttachedTo(entity)

-- always works, by hash
local retval = Citizen.InvokeNative(0xfe1589f9, entity, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetEntityAttachedTo(entity);

// by hash
const retval = Citizen.invokeNative('0xfe1589f9', entity, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0xfe1589f9, entity);

Sources

Cfx.re native reference

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