NETWORK_GET_ENTITY_OWNER
Returns the owner ID of the specified entity.
Signature
int NETWORK_GET_ENTITY_OWNER(Entity entity);Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | 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
Returns the owner ID of the specified entity.
Usage
local retval = NetworkGetEntityOwner(entity)
-- always works, by hash
local retval = Citizen.InvokeNative(0x526fee31, entity, Citizen.ResultAsInteger())JavaScript and C#
const retval = NetworkGetEntityOwner(entity);
// by hash
const retval = Citizen.invokeNative('0x526fee31', entity, Citizen.returnResultAnyway(), Citizen.resultAsInteger());int retval = Function.Call<int>((Hash)0x526fee31, entity);Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.