RedM Index logoRedM Index
NativesHashesClothesBlipsPropsItem Tool
Sign inGet started

Reference

  • Natives
  • Hashes
  • Clothes
  • Blips
  • Props

Namespace

  1. Reference
  2. Natives
  3. CREATE_OBJECT

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 Entity

Parameters

NameTypeDescription
HashThe model to spawn.
floatSpawn coordinate X component.
floatSpawn coordinate Y component.
floatSpawn coordinate Z component, 'ground level'.
BOOLWhether to create a network object for the object. If false, the object exists only locally.
BOOLWhether to register the object as pinned to the script host in the R\* network model.
BOOLFalse 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

On this page

  • Signature
  • Parameters
  • Usage
  • Details