Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Model

Class to create and manage entity models.

Hierarchy

  • Model

Index

Constructors

constructor

  • new Model(hash: number | string): Model
  • Creates a model object based on the hash key or model string.

    Parameters

    • hash: number | string

      A number or string of the model's hash. Example: "mp_m_freemode_01"

    Returns Model

Accessors

Hash

  • get Hash(): number
  • Gets the hash of the model.

    Returns number

    The hash key.

IsLoaded

  • get IsLoaded(): boolean
  • Gets if the model is loaded or not.

    Returns boolean

    Whether this model is loaded.

IsPed

  • get IsPed(): boolean
  • Gets if the model is a Ped or not.

    Returns boolean

    Whether this model is a Ped.

IsVehicle

  • get IsVehicle(): boolean
  • Gets if the model is a Vehicle or not.

    Returns boolean

    Whether this model is a Vehicle.

Methods

markAsNoLongerNeeded

  • markAsNoLongerNeeded(): void
  • Sets the model as no longer needed allowing the game engine to free memory.

    Returns void

request

  • request(timeout: number): Promise<boolean>
  • Request and load the model with a specified timeout. Advised timeout - 1000.

    Parameters

    • timeout: number

      Maximum allowed time for model to load.

    Returns Promise<boolean>

Generated using TypeDoc