WeaponClientChecked by LS:MP1 output

getWeaponComponentHudStats

GET_WEAPON_COMPONENT_HUD_STATS0xB3CAF387AE12E9F8

The GTA V native GET_WEAPON_COMPONENT_HUD_STATS of the WEAPON namespace, as LS:MP client scripts call it: the global function getWeaponComponentHudStats, in JavaScript and in Lua.

SignatureJavaScript
getWeaponComponentHudStats(componentHash: Hash): [
  ok: boolean,
  outData: WeaponHudStats
]
SignatureLua
getWeaponComponentHudStats(componentHash: Hash): boolean, table

Usage

JavaScript
const [ok, outData] = getWeaponComponentHudStats(componentHash);
Lua
local ok, outData = getWeaponComponentHudStats(componentHash)

Parameters

ParameterTypeJavaScriptLua
componentHashHashnumberinteger

Returns

2 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1okBOOLbooleanbooleanThe native’s own return value.
2outDataWeaponHudStatsWeaponHudStatstableoutput

On LS:MP

ℹ
Component UI ratings

Pass the component hash. Read the ratings record only when the leading success value is true.

ℹ
GTA V Enhanced 1158.16

This LS:MP adapter is available on Enhanced 1158.16. Calls on another build raise an error.

Reference

Namespace
Weapon WEAPON
In the game
BOOL GET_WEAPON_COMPONENT_HUD_STATS(Hash componentHash, WeaponHudStats* outData)
Hash
0xB3CAF387AE12E9F8

Open in the interactive natives reference