Options
All
  • Public
  • Public/Protected
  • All
Menu

Class to create and manage entity models.

Hierarchy

  • Model

Index

Constructors

constructor

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

    Parameters

    • hash: string | number

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

    Returns Model

Properties

Private hash

hash: number

Hash of this model.

Accessors

Dimensions

Hash

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

    Returns number

    The hash key.

IsBicycle

  • get IsBicycle(): boolean
  • Gets if the model is a bicycle or not.

    Returns boolean

    Whether this model is a bicycle.

IsBike

  • get IsBike(): boolean
  • Gets if the model is a motorbike or not.

    Returns boolean

    Whether this model is a motorbike.

IsBoat

  • get IsBoat(): boolean
  • Gets if the model is a boat or not.

    Returns boolean

    Whether this model is a boat.

IsCar

  • get IsCar(): boolean
  • Gets if the model is a car or not.

    Returns boolean

    Whether this model is a car.

IsCargobob

  • get IsCargobob(): boolean
  • Gets if the model is a cargobob or not.

    Returns boolean

    Whether this model is a cargobob.

IsCollisionLoaded

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

    Returns boolean

    Whether this model collision is loaded.

IsHelicopter

  • get IsHelicopter(): boolean
  • Gets if the model is a helicopter or not.

    Returns boolean

    Whether this model is a helicopter.

IsInCdImage

  • get IsInCdImage(): boolean
  • Gets if the model is in cd image or not.

    Returns boolean

    Whether this model is in cd image.

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.

IsPlane

  • get IsPlane(): boolean
  • Gets if the model is a plane or not.

    Returns boolean

    Whether this model is a plane.

IsProp

  • get IsProp(): boolean
  • Gets if the model is a prop or not.

    Returns boolean

    Whether this model is a prop.

IsQuadbike

  • get IsQuadbike(): boolean
  • Gets if the model is a quadbike or not.

    Returns boolean

    Whether this model is a quadbike.

IsTrain

  • get IsTrain(): boolean
  • Gets if the model is a train or not.

    Returns boolean

    Whether this model is a train.

IsValid

  • get IsValid(): boolean
  • Gets if the model is valid or not.

    Returns boolean

    Whether this model is valid.

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. Default timeout is 1000 (recommended).

    Parameters

    • timeout: number = 1000

      Maximum allowed time for model to load.

    Returns Promise<boolean>

Generated using TypeDoc