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.Weapon Class Reference

Static Public Member Functions

static implicit operator WeaponHash (Weapon weapon)
 
static string GetDisplayNameFromHash (WeaponHash hash)
 

Public Attributes

string DisplayName => GetDisplayNameFromHash(Hash)
 
string LocalizedName => Game.GetLocalizedString(DisplayName)
 
bool IsPresent => Hash == WeaponHash.Unarmed || Function.Call<bool>(Native.Hash.HAS_PED_GOT_WEAPON, owner.Handle, Hash)
 
Model Model => new Model(Function.Call<int>(Native.Hash.GET_WEAPONTYPE_MODEL, Hash))
 
WeaponGroup Group => Function.Call<WeaponGroup>(Native.Hash.GET_WEAPONTYPE_GROUP, Hash)
 
int DefaultClipSize => Function.Call<int>(Native.Hash.GET_WEAPON_CLIP_SIZE, Hash)
 
bool CanUseOnParachute => Function.Call<bool>(Native.Hash.CAN_USE_WEAPON_ON_PARACHUTE, Hash)
 
WeaponComponentCollection Components => components ?? (components = new WeaponComponentCollection(owner, this))
 

Properties

WeaponHash Hash [get]
 
WeaponTint Tint [get, set]
 
int Ammo [get, set]
 
int AmmoInClip [get, set]
 
int MaxAmmo [get]
 
int MaxAmmoInClip [get]
 
bool InfiniteAmmo [set]
 
bool InfiniteAmmoClip [set]
 

Member Function Documentation

◆ GetDisplayNameFromHash()

static string GTA.Weapon.GetDisplayNameFromHash ( WeaponHash  hash)
static

◆ operator WeaponHash()

static implicit GTA.Weapon.operator WeaponHash ( Weapon  weapon)
static

Member Data Documentation

◆ CanUseOnParachute

bool GTA.Weapon.CanUseOnParachute => Function.Call<bool>(Native.Hash.CAN_USE_WEAPON_ON_PARACHUTE, Hash)

◆ Components

WeaponComponentCollection GTA.Weapon.Components => components ?? (components = new WeaponComponentCollection(owner, this))

◆ DefaultClipSize

int GTA.Weapon.DefaultClipSize => Function.Call<int>(Native.Hash.GET_WEAPON_CLIP_SIZE, Hash)

◆ DisplayName

string GTA.Weapon.DisplayName => GetDisplayNameFromHash(Hash)

◆ Group

WeaponGroup GTA.Weapon.Group => Function.Call<WeaponGroup>(Native.Hash.GET_WEAPONTYPE_GROUP, Hash)

◆ IsPresent

bool GTA.Weapon.IsPresent => Hash == WeaponHash.Unarmed || Function.Call<bool>(Native.Hash.HAS_PED_GOT_WEAPON, owner.Handle, Hash)

◆ LocalizedName

string GTA.Weapon.LocalizedName => Game.GetLocalizedString(DisplayName)

◆ Model

Model GTA.Weapon.Model => new Model(Function.Call<int>(Native.Hash.GET_WEAPONTYPE_MODEL, Hash))

Property Documentation

◆ Ammo

int GTA.Weapon.Ammo
getset

◆ AmmoInClip

int GTA.Weapon.AmmoInClip
getset

◆ Hash

WeaponHash GTA.Weapon.Hash
get

◆ InfiniteAmmo

bool GTA.Weapon.InfiniteAmmo
set

◆ InfiniteAmmoClip

bool GTA.Weapon.InfiniteAmmoClip
set

◆ MaxAmmo

int GTA.Weapon.MaxAmmo
get

◆ MaxAmmoInClip

int GTA.Weapon.MaxAmmoInClip
get

◆ Tint

WeaponTint GTA.Weapon.Tint
getset

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