CREATE_OBJECT
Creates an object of modelHash at the given coordinates and returns its handle, optionally networked.
Load the model first with REQUEST_MODEL and HAS_MODEL_LOADED.
Signature
Object CREATE_OBJECT(Hash modelHash, float x, float y, float z, BOOL isNetwork, BOOL bScriptHostObj, BOOL dynamic, BOOL p7, BOOL p8); // 0x509D5878EB39E842 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | modelHash | Hash |
| 2 | x | float |
| 3 | y | float |
| 4 | z | float |
| 5 | isNetwork | BOOL |
| 6 | bScriptHostObj | BOOL |
| 7 | dynamic | BOOL |
| 8 | p7 | BOOL |
| 9 | p8 | BOOL |
Facts
| Name | CREATE_OBJECT |
|---|---|
| Hash | 0x509D5878EB39E842 |
| Namespace | |
| Returns | Object |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
local objectOut = Citizen.InvokeNative(0x509D5878EB39E842, -- CREATE_OBJECT
GetHashKey("a_c_horse_arabian_white"), -- Hash modelHash
0.0, -- float x
0.0, -- float y
0.0, -- float z
false, -- BOOL isNetwork
false, -- BOOL bScriptHostObj
false, -- BOOL dynamic
false, -- BOOL p7
false, -- BOOL p8
Citizen.ResultAsInteger()
)
print(objectOut)// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const objectOut = Citizen.invokeNative("0x509D5878EB39E842", // CREATE_OBJECT
GetHashKey("a_c_horse_arabian_white"), // Hash modelHash
0.0, // float x
0.0, // float y
0.0, // float z
false, // BOOL isNetwork
false, // BOOL bScriptHostObj
false, // BOOL dynamic
false, // BOOL p7
false, // BOOL p8
Citizen.resultAsInteger()
);
console.log(objectOut)int objectOut = Function.Call<int>((Hash)0x509D5878EB39E842, // CREATE_OBJECT
(uint)API.GetHashKey("a_c_horse_arabian_white"), // Hash modelHash
0.0f, // float x
0.0f, // float y
0.0f, // float z
false, // BOOL isNetwork
false, // BOOL bScriptHostObj
false, // BOOL dynamic
false, // BOOL p7
false // BOOL p8
);Related OBJECT natives
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.