gta.createObject

Function Server and Client icon-iii.png icon-vc.png icon-sa.png icon-iv.png Online and Offline

Available since Server 1.0.0, Client 1.0.0

Object gta.createObject(int model, Vec3 position)

The gta.createObject function is used to create a visual object for the local client.

Parameters

1) int model The model ID for the object.
2) Vec3 position The 3D position for the object. Server only.

Return

Object An object representing the visual game object that was created.

Notes

  • gta.createObject doesn't function properly on the client.

Examples

Example 1 - Lua:

object = gta.createObject(1335, Vec3(1062.316, -662.653, 14.652))
if object ~= nil then
object.heading = 1.5922862291336
end

Compatibility

There isn't any compatibility information for this function.

Related

Server Related

        getObjectCount
        getObjects
        gta.createObject
        registerNetObject

        object.children
        object.clearExistsFor
        object.dimension
        object.existsFor
        object.getData
        object.getRotation
        object.heading
        object.id
        object.interior
        object.isCreatedFor
        object.isLocal
        object.isOwner
        object.isSyncer
        object.isType
        object.matrix
        object.modelIndex
        object.name
        object.netFlags
        object.parent
        object.position
        object.removeAllData
        object.removeData
        object.resource
        object.rotation
        object.setData
        object.setExistsFor
        object.setRotation
        object.setSyncer
        object.streamInDistance
        object.streamOutDistance
        object.syncer
        object.syncerId
        object.turnVelocity
        object.type
        object.velocity


Client Related

      getObjectCount
      getObjects
  gta.convertAllObjectsToDummyObjects
      gta.createObject
      gta.removeWorldObject
      gta.setVisibilityOfClosestObjectOfType
        registerNetObject

      object.affectedByGravity
  object.alpha
      object.boundingCentre
      object.boundingMax
      object.boundingMin
      object.boundingRadius
      object.centerOfMass
        object.children
        object.clearExistsFor
      object.collisionBoxCount
      object.collisionBoxes
      object.collisionLineCount
      object.collisionLines
      object.collisionPower
      object.collisionsEnabled
      object.collisionSphereCount
      object.collisionSpheres
      object.collisionVertexCount
      object.collisionVertices
        object.dimension
      object.distanceFromCentreOfMassToBaseOfModel
        object.existsFor
        object.getData
        object.getRotation
        object.heading
  object.health
        object.id
      object.interior
      object.inWater
        object.isCreatedFor
  object.island
        object.isLocal
      object.isOnScreen
        object.isOwner
        object.isSyncer
        object.isType
      object.markAsNoLongerNeeded
      object.mass
        object.matrix
      object.model
        object.modelIndex
        object.name
        object.netFlags
      object.onScreen
        object.parent
        object.position
        object.removeAllData
        object.removeData
        object.resource
        object.rotation
        object.setData
        object.setExistsFor
      object.setProofs
        object.setRotation
        object.setSyncer
      object.status
        object.streamInDistance
        object.streamOutDistance
        object.syncer
        object.syncerId
        object.turnVelocity
        object.type
        object.velocity
      object.visible