CREATE_OBJECT
Creates an object (prop) with the specified model at the specified position, offset on the Z axis by the radius of the object's model. This object will initially be owned by the creating script as a mission entity, and the model should be loaded already (e.g. using REQUEST_MODEL). **This is the server-side RPC native equivalent of the client native [CREATE_OBJECT](?\_0x509D5878EB39E842).**
CFX
Signature
lua
CreateObject(GetHashKey("..."), 0.0, 0.0, 0.0, true, true, true)
-- returns EntityParameters
| Name | Type | Description |
|---|---|---|
| Hash | The model to spawn. | |
| float | Spawn coordinate X component. | |
| float | Spawn coordinate Y component. | |
| float | Spawn coordinate Z component, 'ground level'. | |
| BOOL | Whether to create a network object for the object. If false, the object exists only locally. | |
| BOOL | Whether to register the object as pinned to the script host in the R\* network model. | |
| BOOL | False to create a door archetype (archetype flag bit 26 set) as a door. Required to be set to true to create door models in network mode. |
Usage
lua
CreateObject(GetHashKey("..."), 0.0, 0.0, 0.0, true, true, true)Generated from the native name, hash, and parameter list. Add a real example.
Details
- Hash
- API set
- Source
- cfx
Source: cfx
