CreateObject

From GTA Network Wiki
Jump to: navigation, search

CreateObject
Server-Side Function

utilities-terminal.png Server-Side csharp.png C#

Creates an object. External websites (not created by GTA Network) that displays objects with pictures and their model integer can be found below.

http://gtan.codeshock.hu/objects/

This function has 2 overloads.

Syntax

Object NAPI.Object.CreateObject(int/uint model, Vector3 pos, Vector3 rot [, byte alpha = 255, uint dimension = NAPI.GlobalDimension ]);
Object NAPI.Object.CreateObject(int/uint model, Vector3 pos, Quaternion rot [, uint dimension = NAPI.GlobalDimension ]);

Required Arguments

  • model: parameter input should be in int or uint type.
  • pos: parameter input should be in Vector3 type.
  • rot: parameter input should be in Vector3 or Quaternion type.

Optional Arguments

  • alpha: only available when using Vector3 type for rot. Parameter input should be in byte type.
  • dimension: parameter input should be in int type.

NOTE: This function returns data in Object type.

Remember, you can delete Objects using DeleteEntity.

Usage examples

NAPI.Object.CreateObject(model, oPos, oRot); //Spawned object is visible in all Dimensions
NAPI.Object.CreateObject(model, oPos, oRot, 255, 10); //Spawned object is visible only in Dimension 10

Changelog

Version Description
1.0 Release.