WeaponClient

getWeaponComponentVariantExtraCount

GET_WEAPON_COMPONENT_VARIANT_EXTRA_COUNT0x6558AC7C17BFEF58

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

SignatureJavaScript
getWeaponComponentVariantExtraCount(componentHash: Hash): number
SignatureLua
getWeaponComponentVariantExtraCount(componentHash: Hash): integer

Usage

JavaScript
const result = getWeaponComponentVariantExtraCount(componentHash);
Lua
local result = getWeaponComponentVariantExtraCount(componentHash)

Parameters

ParameterTypeJavaScriptLua
componentHashHashnumberinteger

Returns

int JavaScript number, Lua integer

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Returns the amount of extra components the specified component has.

Reference

Namespace
Weapon WEAPON
In the game
int GET_WEAPON_COMPONENT_VARIANT_EXTRA_COUNT(Hash componentHash)
Hash
0x6558AC7C17BFEF58
Introduced
Game build 372 legacy numbering
Formerly
_GET_WEAPON_COMPONENT_VARIANT_EXTRA_COMPONENT_COUNT

Open in the interactive natives reference