Class to create and manage entity models.

### Hierarchy

- Model

## Index

### Constructors

- constructor

### Properties

- hash

### Accessors

- Dimensions
- Hash
- IsBicycle
- IsBike
- IsBoat
- IsCar
- IsCargobob
- IsCollisionLoaded
- IsHelicopter
- IsInCdImage
- IsLoaded
- IsPed
- IsPlane
- IsProp
- IsQuadbike
- IsTrain
- IsValid
- IsVehicle

### Methods

- getClosestObject
- markAsNoLongerNeeded
- request

## Constructors

### constructor

- new Model(hash: string | number): Model

- - Defined in Model.ts:20

  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

- Defined in Model.ts:13

Hash of this model.

## Accessors

### Dimensions

- get Dimensions(): Vector3

- - Defined in Model.ts:191

  Gets the model dimensions.

  #### Returns Vector3

  This model dimensions.

### Hash

- get Hash(): number

- - Defined in Model.ts:33

  Gets the hash of the model.

  #### Returns number

  The hash key.

### IsBicycle

- get IsBicycle(): boolean

- - Defined in Model.ts:78

  Gets if the model is a bicycle or not.

  #### Returns boolean

  Whether this model is a bicycle.

### IsBike

- get IsBike(): boolean

- - Defined in Model.ts:87

  Gets if the model is a motorbike or not.

  #### Returns boolean

  Whether this model is a motorbike.

### IsBoat

- get IsBoat(): boolean

- - Defined in Model.ts:96

  Gets if the model is a boat or not.

  #### Returns boolean

  Whether this model is a boat.

### IsCar

- get IsCar(): boolean

- - Defined in Model.ts:105

  Gets if the model is a car or not.

  #### Returns boolean

  Whether this model is a car.

### IsCargobob

- get IsCargobob(): boolean

- - Defined in Model.ts:114

  Gets if the model is a cargobob or not.

  #### Returns boolean

  Whether this model is a cargobob.

### IsCollisionLoaded

- get IsCollisionLoaded(): boolean

- - Defined in Model.ts:69

  Gets if the model collision is loaded or not.

  #### Returns boolean

  Whether this model collision is loaded.

### IsHelicopter

- get IsHelicopter(): boolean

- - Defined in Model.ts:128

  Gets if the model is a helicopter or not.

  #### Returns boolean

  Whether this model is a helicopter.

### IsInCdImage

- get IsInCdImage(): boolean

- - Defined in Model.ts:51

  Gets if the model is in cd image or not.

  #### Returns boolean

  Whether this model is in cd image.

### IsLoaded

- get IsLoaded(): boolean

- - Defined in Model.ts:60

  Gets if the model is loaded or not.

  #### Returns boolean

  Whether this model is loaded.

### IsPed

- get IsPed(): boolean

- - Defined in Model.ts:137

  Gets if the model is a Ped or not.

  #### Returns boolean

  Whether this model is a Ped.

### IsPlane

- get IsPlane(): boolean

- - Defined in Model.ts:146

  Gets if the model is a plane or not.

  #### Returns boolean

  Whether this model is a plane.

### IsProp

- get IsProp(): boolean

- - Defined in Model.ts:155

  Gets if the model is a prop or not.

  #### Returns boolean

  Whether this model is a prop.

### IsQuadbike

- get IsQuadbike(): boolean

- - Defined in Model.ts:164

  Gets if the model is a quadbike or not.

  #### Returns boolean

  Whether this model is a quadbike.

### IsTrain

- get IsTrain(): boolean

- - Defined in Model.ts:173

  Gets if the model is a train or not.

  #### Returns boolean

  Whether this model is a train.

### IsValid

- get IsValid(): boolean

- - Defined in Model.ts:42

  Gets if the model is valid or not.

  #### Returns boolean

  Whether this model is valid.

### IsVehicle

- get IsVehicle(): boolean

- - Defined in Model.ts:182

  Gets if the model is a Vehicle or not.

  #### Returns boolean

  Whether this model is a Vehicle.

## Methods

### getClosestObject

- getClosestObject(coords: Vector3, radius?: number, isMission?: boolean): null | Prop

- - Defined in Model.ts:223

  Gets the closest object of this model

  #### Parameters

  - ##### coords: Vector3

  - ##### radius: number = 25.0

  - ##### isMission: boolean = false

  #### Returns null | Prop

### markAsNoLongerNeeded

- markAsNoLongerNeeded(): void

- - Defined in Model.ts:235

  Sets the model as no longer needed allowing the game engine to free memory.

  #### Returns void

### request

- request(timeout?: number): Promise<boolean>

- - Defined in Model.ts:203

  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