NetworkClient

objToNet

OBJ_TO_NET0x99BFDC94A603E541

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

SignatureJavaScript
objToNet(object: Object): number
SignatureLua
objToNet(object: Object): integer

Usage

JavaScript
const result = objToNet(object);
Lua
local result = objToNet(object)

Parameters

ParameterTypeJavaScriptLua
objectObjectnumberinteger

Returns

int JavaScript number, Lua integer

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Lets objects spawn online simply do it like this:

int createdObject = objToNet(createObjectNoOffset(oball, pCoords.x, pCoords.y, pCoords.z, 1, 0, 0));

Reference

Namespace
Network NETWORK
In the game
int OBJ_TO_NET(Object object)
Hash
0x99BFDC94A603E541

Open in the interactive natives reference