createObjectNoOffset
CREATE_OBJECT_NO_OFFSET0x9A294B2138ABB884The GTA V native CREATE_OBJECT_NO_OFFSET of the OBJECT namespace, as LS:MP client scripts call it: the global function createObjectNoOffset, in JavaScript and in Lua.
createObjectNoOffset(
modelHash: Hash,
x: number,
y: number,
z: number,
isNetwork: boolean,
bScriptHostObj: boolean,
dynamic: boolean,
p7: any
): ObjectcreateObjectNoOffset(
modelHash: Hash,
x: number,
y: number,
z: number,
isNetwork: boolean,
bScriptHostObj: boolean,
dynamic: boolean,
p7: any
): ObjectUsage
JavaScript
const object = createObjectNoOffset(modelHash, x, y, z, isNetwork, bScriptHostObj, dynamic, p7);Lua
local object = createObjectNoOffset(modelHash, x, y, z, isNetwork, bScriptHostObj, dynamic, p7)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
JavaScript · with vectors
const object = createObjectNoOffset(modelHash, pos, isNetwork, bScriptHostObj, dynamic, p7);Lua · with vectors
local object = createObjectNoOffset(modelHash, pos, isNetwork, bScriptHostObj, dynamic, p7)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
modelHash | Hash | number | integer |
x | float | number | number |
y | float | number | number |
z | float | number | number |
isNetwork | BOOL | boolean | boolean |
bScriptHostObj | BOOL | boolean | boolean |
dynamic | BOOL | boolean | boolean |
p7 | Any | any | any |
Returns
Object JavaScript number, Lua integerGame handle of an object (prop). Not an LS:MP netId. Convert one with lsmp.getEntityFromNetId.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
List of object models that can be created without any additional effort like making sure ytyp is loaded etc: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/ObjectList.ini
Reference
- Namespace
- Object OBJECT
- In the game
Object CREATE_OBJECT_NO_OFFSET(Hash modelHash, float x, float y, float z, BOOL isNetwork, BOOL bScriptHostObj, BOOL dynamic, Any p7)- Hash
0x9A294B2138ABB884