Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Entity

Hierarchy

Index

Properties

Readonly id

id: number

Entity unique id

Readonly model

model: number

Hash of entity model

Readonly pos

pos: Vector3

Object position

Readonly rot

rot: Vector3

Entity rotation in radians

Readonly scriptID

scriptID: number

Internal game id that can be used in native calls

Readonly type

Type of the object.

Readonly valid

valid: boolean

Object usability.

returns

False if object is no longer usable.

Readonly visible

visible: boolean
beta

Static Readonly all

all: Array<Entity>
beta

Methods

deleteMeta

  • deleteMeta(key: string): void

destroy

  • destroy(): void

getMeta

  • getMeta(key: string): any
  • Gets a value using the specified key.

    Parameters

    • key: string

      The key of the value to get.

    Returns any

    Dynamic value associated with the specified key.

getStreamSyncedMeta

  • getStreamSyncedMeta(key: string): any
  • Gets a value using the specified key.

    Parameters

    • key: string

      The key of the value to get.

    Returns any

    Dynamic value associated with the specified key.

getSyncedMeta

  • getSyncedMeta(key: string): any
  • Gets a value using the specified key.

    Parameters

    • key: string

      The key of the value to get.

    Returns any

    Dynamic value associated with the specified key.

hasMeta

  • hasMeta(key: string): boolean
  • Determines whether contains the specified key.

    Parameters

    • key: string

      The key of the value to locate.

    Returns boolean

    True when element associated with the specified key is stored.

hasStreamSyncedMeta

  • hasStreamSyncedMeta(key: string): boolean
  • Determines whether contains the specified key.

    Parameters

    • key: string

      The key of the value to locate.

    Returns boolean

    Return is dependent on whether element associated with the specified key is stored.

hasSyncedMeta

  • hasSyncedMeta(key: string): boolean
  • Determines whether contains the specified key.

    Parameters

    • key: string

      The key of the value to locate.

    Returns boolean

    Return is dependent on whether element associated with the specified key is stored.

setMeta

  • setMeta(key: string, value: any): void
  • Stores the given value with the specified key.

    remarks

    The given value will be shared locally.

    Parameters

    • key: string

      The key of the value to store.

    • value: any

    Returns void

Static getByID

  • getByID(id: number): Entity | null
  • Retrieves the entity from the pool.

    Parameters

    • id: number

      The id of the entity.

    Returns Entity | null

    Entity if it was found, otherwise null.

Static getByScriptID

  • getByScriptID(scriptID: number): Entity | null
  • Retrieves the entity from the pool.

    Parameters

    • scriptID: number

      The script id of the entity.

    Returns Entity | null

    Entity if it was found, otherwise null.