Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VirtualEntity

Hierarchy

Index

Constructors

constructor

Properties

dimension

dimension: number

Object dimension.

remarks

Check https://docs.altv.mp/articles/dimensions.html to understand how it works.

Readonly group

Virtual Entity Group this entity belongs to

Readonly id

id: number

Readonly isRemote

isRemote: boolean

Whether this entity was created clientside or serverside. (Clientside = false, Serverside = true).

Readonly isStreamedIn

isStreamedIn: boolean

pos

pos: Vector3

Object position

Readonly refCount

refCount: number

Returns the ref count of the entity.

remarks

It's only available in debug-mode.

Readonly remoteID

remoteID: number

The serverside id of this entity.

Readonly type

Type of the object.

Readonly valid

valid: boolean

Object usability.

returns

False if object is no longer usable.

visible

visible: boolean

Static Readonly all

all: readonly VirtualEntity[]

Returns all Virtual Entity instances

Static Readonly streamedIn

streamedIn: readonly VirtualEntity[]

Methods

deleteMeta

  • deleteMeta(key: string): void
  • deleteMeta<K>(key: K): void

destroy

  • destroy(): void
  • Removes the object from the world.

    Returns void

getMeta

  • getMeta<K>(key: Exclude<K, keyof ICustomBaseObjectMeta>): unknown
  • getMeta<K>(key: K): ICustomBaseObjectMeta[K] | undefined
  • getMeta<V>(key: string): V | undefined

getMetaDataKeys

  • getMetaDataKeys(): readonly string[]

getStreamSyncedMeta

  • getStreamSyncedMeta<K>(key: Exclude<K, keyof ICustomVirtualEntityStreamSyncedMeta>): unknown
  • getStreamSyncedMeta<K>(key: K): ICustomVirtualEntityStreamSyncedMeta[K] | undefined
  • getStreamSyncedMeta<V>(key: string): V | undefined
  • Gets a value using the specified key. Only available for server-side created Virtual Entities.

    Type parameters

    • K: string

    Parameters

    Returns unknown

    Dynamic value associated with the specified key or undefined if no data is present.

  • Type parameters

    Parameters

    • key: K

    Returns ICustomVirtualEntityStreamSyncedMeta[K] | undefined

  • Type parameters

    • V: any

    Parameters

    • key: string

    Returns V | undefined

getStreamSyncedMetaKeys

  • getStreamSyncedMetaKeys(): readonly string[]
  • Returns all set meta keys of the Virtual Entity. Only available for server-side created Virtual Entities.

    Returns readonly string[]

getSyncedMeta

  • getSyncedMeta<K>(key: Exclude<K, keyof ICustomBaseObjectSyncedMeta>): unknown
  • getSyncedMeta<K>(key: K): ICustomBaseObjectSyncedMeta[K] | undefined
  • getSyncedMeta<V>(key: string): V | undefined

getSyncedMetaKeys

  • getSyncedMetaKeys(): readonly string[]

hasMeta

  • hasMeta(key: string): boolean
  • hasMeta<K>(key: K): boolean

hasStreamSyncedMeta

  • hasStreamSyncedMeta(key: string): boolean
  • hasStreamSyncedMeta<K>(key: K): boolean
  • Determines whether contains the specified key. Only available for server-side created Virtual Entities.

    Parameters

    • key: string

      The key of the value to locate.

    Returns boolean

    True if the meta table contains any data at the specified key or False if not

  • Type parameters

    Parameters

    • key: K

    Returns boolean

hasSyncedMeta

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

    Parameters

    • key: string

      The key of the value to locate.

    Returns boolean

    True if the meta table contains any data at the specified key or False if not

  • Type parameters

    Parameters

    • key: K

    Returns boolean

setMeta

  • setMeta<K>(key: K, value: shared.InterfaceValueByKey<ICustomBaseObjectMeta, K>): void
  • setMeta<K>(key: K, value: ICustomBaseObjectMeta[K]): void
  • setMeta<V, K>(key: K, value: shared.InterfaceValueByKey<ICustomBaseObjectMeta, K, V>): void

Static getByID

Static getByRemoteID