RedM Natives

NETWORK_GET_ENTITY_OWNER

Returns the owner ID of the specified entity.

Hash0x526FEE31
Runtime nameNetworkGetEntityOwner
NamespaceCFX
SideClient + server
NameOfficial
Docs

Signature

int NETWORK_GET_ENTITY_OWNER(Entity entity);

Parameters

NameTypeDescription
entityEntity

The entity to get the owner for.

Returns int — On the server, the server ID of the entity owner. On the client, returns the player/slot ID of the entity owner.

Description

Cfx.re native reference

Returns the owner ID of the specified entity.

Usage

Lua
local retval = NetworkGetEntityOwner(entity)

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

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

Sources

Cfx.re native reference

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