SHVDN  v3
An ASI plugin for Grand Theft Auto V, which allows running scripts written in any .NET language in-game. Developed by crosire https://github.com/crosire/scripthookvdotnet/
GTA.Model Struct Reference
Inheritance diagram for GTA.Model:
GTA.Native.INativeValue

Public Member Functions

 Model (int hash)
 
 Model (string name)
 
 Model (PedHash hash)
 
 Model (WeaponHash hash)
 
 Model (VehicleHash hash)
 
void Request ()
 Attempts to load this Model into memory. More...
 
bool Request (int timeout)
 Attempts to load this Model into memory for a given period of time. More...
 
void RequestCollision ()
 Attempts to load this Model's collision into memory. More...
 
bool RequestCollision (int timeout)
 Attempts to load this Model's collision into memory for a given period of time. More...
 
void MarkAsNoLongerNeeded ()
 Tells the game we have finished using this Model and it can be freed from memory. More...
 
bool Equals (Model model)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
override string ToString ()
 

Static Public Member Functions

static bool operator== (Model left, Model right)
 
static bool operator!= (Model left, Model right)
 
static implicit operator int (Model source)
 
static implicit operator PedHash (Model source)
 
static implicit operator WeaponHash (Model source)
 
static implicit operator VehicleHash (Model source)
 
static implicit operator Model (int source)
 
static implicit operator Model (string source)
 
static implicit operator Model (PedHash source)
 
static implicit operator Model (WeaponHash source)
 
static implicit operator Model (VehicleHash source)
 
static implicit operator InputArgument (Model value)
 

Public Attributes

bool IsValid => Function.Call<bool>(Native.Hash.IS_MODEL_VALID, Hash)
 Gets if this Model is valid. More...
 
bool IsInCdImage => Function.Call<bool>(Native.Hash.IS_MODEL_IN_CDIMAGE, Hash)
 Gets a value indicating whether this Model is in the CD image. More...
 
bool IsLoaded => Function.Call<bool>(Native.Hash.HAS_MODEL_LOADED, Hash)
 Gets a value indicating whether this Model is loaded so it can be spawned. More...
 
bool IsCollisionLoaded => Function.Call<bool>(Native.Hash.HAS_COLLISION_FOR_MODEL_LOADED, Hash)
 Gets a value indicating whether the collision for this Model is loaded. More...
 
bool IsAmphibiousCar => Game.Version >= GameVersion.v1_0_944_2_Steam && Function.Call<bool>(Native.Hash._IS_THIS_MODEL_AN_AMPHIBIOUS_CAR, Hash)
 Gets a value indicating whether this Model is an amphibious car. More...
 
bool IsAmphibiousQuadBike => Game.Version >= GameVersion.v1_0_944_2_Steam && Function.Call<bool>(Native.Hash._IS_THIS_MODEL_AN_AMPHIBIOUS_QUADBIKE, Hash)
 Gets a value indicating whether this Model is an amphibious quad bike. More...
 
bool IsAmphibiousVehicle => IsAmphibiousCar || IsAmphibiousQuadBike
 Gets a value indicating whether this Model is an amphibious vehicle. More...
 
bool IsBicycle => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_BICYCLE, Hash)
 Gets a value indicating whether this Model is a bicycle. More...
 
bool IsBike => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_BIKE, Hash)
 Gets a value indicating whether this Model is a motorbike. More...
 
bool IsBlimp => SHVDN.NativeMemory.IsModelABlimp(Hash)
 Gets a value indicating whether this Model is a blimp. More...
 
bool IsBoat => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_BOAT, Hash)
 Gets a value indicating whether this Model is a boat. More...
 
bool IsCar => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_CAR, Hash)
 Gets a value indicating whether this Model is a car. More...
 
bool IsCargobob => (VehicleHash)Hash == VehicleHash.Cargobob || (VehicleHash)Hash == VehicleHash.Cargobob2 || (VehicleHash)Hash == VehicleHash.Cargobob3 || (VehicleHash)Hash == VehicleHash.Cargobob4
 Gets a value indicating whether this Model is a cargobob. More...
 
bool IsHelicopter => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_HELI, Hash)
 Gets a value indicating whether this Model is a helicopter. More...
 
bool IsJetSki => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_JETSKI, Hash)
 Gets a value indicating whether this Model is a jet ski. More...
 
bool IsPed => SHVDN.NativeMemory.IsModelAPed(Hash)
 Gets a value indicating whether this Model is a pedestrian. More...
 
bool IsPlane => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_PLANE, Hash)
 Gets a value indicating whether this Model is a plane. More...
 
bool IsProp => IsValid && !IsPed && !IsVehicle
 Gets a value indicating whether this Model is a prop. More...
 
bool IsQuadBike => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_QUADBIKE, Hash)
 Gets a value indicating whether this Model is a quad bike. More...
 
bool IsTrain => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_TRAIN, Hash)
 Gets a value indicating whether this Model is a train. More...
 
bool IsTrailer => SHVDN.NativeMemory.IsModelATrailer(Hash)
 Gets a value indicating whether this Model is a trailer. More...
 
bool IsVehicle => Function.Call<bool>(Native.Hash.IS_MODEL_A_VEHICLE, Hash)
 Gets a value indicating whether this Model is a vehicle. More...
 
Vector3 rearBottomLeft
 Gets the dimensions of this Model. More...
 

Properties

int Hash [get]
 Gets the hash for this Model. More...
 
ulong NativeValue [get, set]
 Gets the native representation of this Model. More...
 
Vector3 Vector3 frontTopRight Dimensions [get]
 
- Properties inherited from GTA.Native.INativeValue
ulong NativeValue [get, set]
 

Constructor & Destructor Documentation

◆ Model() [1/5]

GTA.Model.Model ( int  hash)

◆ Model() [2/5]

GTA.Model.Model ( string  name)

◆ Model() [3/5]

GTA.Model.Model ( PedHash  hash)

◆ Model() [4/5]

GTA.Model.Model ( WeaponHash  hash)

◆ Model() [5/5]

GTA.Model.Model ( VehicleHash  hash)

Member Function Documentation

◆ Equals() [1/2]

bool GTA.Model.Equals ( Model  model)

◆ Equals() [2/2]

override bool GTA.Model.Equals ( object  obj)

◆ GetHashCode()

override int GTA.Model.GetHashCode ( )

◆ MarkAsNoLongerNeeded()

void GTA.Model.MarkAsNoLongerNeeded ( )

Tells the game we have finished using this Model and it can be freed from memory.

◆ operator InputArgument()

static implicit GTA.Model.operator InputArgument ( Model  value)
static

◆ operator int()

static implicit GTA.Model.operator int ( Model  source)
static

◆ operator Model() [1/5]

static implicit GTA.Model.operator Model ( int  source)
static

◆ operator Model() [2/5]

static implicit GTA.Model.operator Model ( PedHash  source)
static

◆ operator Model() [3/5]

static implicit GTA.Model.operator Model ( string  source)
static

◆ operator Model() [4/5]

static implicit GTA.Model.operator Model ( VehicleHash  source)
static

◆ operator Model() [5/5]

static implicit GTA.Model.operator Model ( WeaponHash  source)
static

◆ operator PedHash()

static implicit GTA.Model.operator PedHash ( Model  source)
static

◆ operator VehicleHash()

static implicit GTA.Model.operator VehicleHash ( Model  source)
static

◆ operator WeaponHash()

static implicit GTA.Model.operator WeaponHash ( Model  source)
static

◆ operator!=()

static bool GTA.Model.operator!= ( Model  left,
Model  right 
)
static

◆ operator==()

static bool GTA.Model.operator== ( Model  left,
Model  right 
)
static

◆ Request() [1/2]

void GTA.Model.Request ( )

Attempts to load this Model into memory.

◆ Request() [2/2]

bool GTA.Model.Request ( int  timeout)

Attempts to load this Model into memory for a given period of time.

Parameters
timeoutThe time (in milliseconds) before giving up trying to load this Model.
Returns
true if this Model is loaded; otherwise, false.

◆ RequestCollision() [1/2]

void GTA.Model.RequestCollision ( )

Attempts to load this Model's collision into memory.

◆ RequestCollision() [2/2]

bool GTA.Model.RequestCollision ( int  timeout)

Attempts to load this Model's collision into memory for a given period of time.

Parameters
timeoutThe time (in milliseconds) before giving up trying to load this Model.
Returns
true if this Model's collision is loaded; otherwise, false.

◆ ToString()

override string GTA.Model.ToString ( )

Member Data Documentation

◆ IsAmphibiousCar

bool GTA.Model.IsAmphibiousCar => Game.Version >= GameVersion.v1_0_944_2_Steam && Function.Call<bool>(Native.Hash._IS_THIS_MODEL_AN_AMPHIBIOUS_CAR, Hash)

Gets a value indicating whether this Model is an amphibious car.

true if this Model is an amphibious car; otherwise, false.

◆ IsAmphibiousQuadBike

bool GTA.Model.IsAmphibiousQuadBike => Game.Version >= GameVersion.v1_0_944_2_Steam && Function.Call<bool>(Native.Hash._IS_THIS_MODEL_AN_AMPHIBIOUS_QUADBIKE, Hash)

Gets a value indicating whether this Model is an amphibious quad bike.

true if this Model is an amphibious quad bike; otherwise, false.

◆ IsAmphibiousVehicle

bool GTA.Model.IsAmphibiousVehicle => IsAmphibiousCar || IsAmphibiousQuadBike

Gets a value indicating whether this Model is an amphibious vehicle.

true if this Model is an amphibious vehicle; otherwise, false.

◆ IsBicycle

bool GTA.Model.IsBicycle => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_BICYCLE, Hash)

Gets a value indicating whether this Model is a bicycle.

true if this Model is a bicycle; otherwise, false.

◆ IsBike

bool GTA.Model.IsBike => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_BIKE, Hash)

Gets a value indicating whether this Model is a motorbike.

true if this Model is a motorbike; otherwise, false.

◆ IsBlimp

bool GTA.Model.IsBlimp => SHVDN.NativeMemory.IsModelABlimp(Hash)

Gets a value indicating whether this Model is a blimp.

true if this Model is a blimp; otherwise, false.

◆ IsBoat

bool GTA.Model.IsBoat => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_BOAT, Hash)

Gets a value indicating whether this Model is a boat.

true if this Model is a boat; otherwise, false.

◆ IsCar

bool GTA.Model.IsCar => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_CAR, Hash)

Gets a value indicating whether this Model is a car.

true if this Model is a car; otherwise, false.

◆ IsCargobob

Gets a value indicating whether this Model is a cargobob.

true if this Model is a cargobob; otherwise, false.

◆ IsCollisionLoaded

bool GTA.Model.IsCollisionLoaded => Function.Call<bool>(Native.Hash.HAS_COLLISION_FOR_MODEL_LOADED, Hash)

Gets a value indicating whether the collision for this Model is loaded.

true if the collision is loaded; otherwise, false.

◆ IsHelicopter

bool GTA.Model.IsHelicopter => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_HELI, Hash)

Gets a value indicating whether this Model is a helicopter.

true if this Model is a helicopter; otherwise, false.

◆ IsInCdImage

bool GTA.Model.IsInCdImage => Function.Call<bool>(Native.Hash.IS_MODEL_IN_CDIMAGE, Hash)

Gets a value indicating whether this Model is in the CD image.

true if this Model is in the CD image; otherwise, false.

◆ IsJetSki

bool GTA.Model.IsJetSki => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_JETSKI, Hash)

Gets a value indicating whether this Model is a jet ski.

true if this Model is a jet ski; otherwise, false.

◆ IsLoaded

bool GTA.Model.IsLoaded => Function.Call<bool>(Native.Hash.HAS_MODEL_LOADED, Hash)

Gets a value indicating whether this Model is loaded so it can be spawned.

true if this Model is loaded; otherwise, false.

◆ IsPed

bool GTA.Model.IsPed => SHVDN.NativeMemory.IsModelAPed(Hash)

Gets a value indicating whether this Model is a pedestrian.

true if this Model is a pedestrian; otherwise, false.

◆ IsPlane

bool GTA.Model.IsPlane => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_PLANE, Hash)

Gets a value indicating whether this Model is a plane.

true if this Model is a plane; otherwise, false.

◆ IsProp

bool GTA.Model.IsProp => IsValid && !IsPed && !IsVehicle

Gets a value indicating whether this Model is a prop.

true if this Model is a prop; otherwise, false.

◆ IsQuadBike

bool GTA.Model.IsQuadBike => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_QUADBIKE, Hash)

Gets a value indicating whether this Model is a quad bike.

true if this Model is a quad bike; otherwise, false.

◆ IsTrailer

bool GTA.Model.IsTrailer => SHVDN.NativeMemory.IsModelATrailer(Hash)

Gets a value indicating whether this Model is a trailer.

true if this Model is a trailer; otherwise, false.

◆ IsTrain

bool GTA.Model.IsTrain => Function.Call<bool>(Native.Hash.IS_THIS_MODEL_A_TRAIN, Hash)

Gets a value indicating whether this Model is a train.

true if this Model is a train; otherwise, false.

◆ IsValid

bool GTA.Model.IsValid => Function.Call<bool>(Native.Hash.IS_MODEL_VALID, Hash)

Gets if this Model is valid.

true if this Model is valid; otherwise, false.

◆ IsVehicle

bool GTA.Model.IsVehicle => Function.Call<bool>(Native.Hash.IS_MODEL_A_VEHICLE, Hash)

Gets a value indicating whether this Model is a vehicle.

true if this Model is a vehicle; otherwise, false.

◆ rearBottomLeft

Vector3 GTA.Model.rearBottomLeft

Gets the dimensions of this Model.

Returns
rearBottomLeft is the minimum dimensions, which contains the rear bottom left relative offset from the origin of the model, frontTopRight is the maximum dimensions, which contains the front top right relative offset from the origin of the model.

Property Documentation

◆ Dimensions

Vector3 Vector3 frontTopRight GTA.Model.Dimensions
get

◆ Hash

int GTA.Model.Hash
get

Gets the hash for this Model.

◆ NativeValue

ulong GTA.Model.NativeValue
getset

Gets the native representation of this Model.


The documentation for this struct was generated from the following file: