NetworkClient

networkGetEntityFromNetworkId

NETWORK_GET_ENTITY_FROM_NETWORK_ID0xCE4E5D9B0A4FF560

The GTA V native NETWORK_GET_ENTITY_FROM_NETWORK_ID of the NETWORK namespace, as LS:MP client scripts call it: the global function networkGetEntityFromNetworkId, in JavaScript and in Lua.

SignatureJavaScript
networkGetEntityFromNetworkId(netId: number): Entity
SignatureLua
networkGetEntityFromNetworkId(netId: integer): Entity

Usage

JavaScript
const entity = networkGetEntityFromNetworkId(netId);
Lua
local entity = networkGetEntityFromNetworkId(netId)

Parameters

ParameterTypeJavaScriptLua
netIdintnumberinteger

Returns

Entity JavaScript number, Lua integer

Game handle of an entity: a ped, a vehicle or an object. Not an LS:MP netId. Convert one with lsmp.getEntityFromNetId.

Reference

Namespace
Network NETWORK
In the game
Entity NETWORK_GET_ENTITY_FROM_NETWORK_ID(int netId)
Hash
0xCE4E5D9B0A4FF560

Open in the interactive natives reference