WeaponClient

hasWeaponGotWeaponComponent

HAS_WEAPON_GOT_WEAPON_COMPONENT0x76A18844E743BF91

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

SignatureJavaScript
hasWeaponGotWeaponComponent(weapon: Object, componentHash: Hash): boolean
SignatureLua
hasWeaponGotWeaponComponent(weapon: Object, componentHash: Hash): boolean

Usage

JavaScript
const result = hasWeaponGotWeaponComponent(weapon, componentHash);
Lua
local result = hasWeaponGotWeaponComponent(weapon, componentHash)

Parameters

ParameterTypeJavaScriptLua
weaponObjectnumberinteger
componentHashHashnumberinteger

Returns

BOOL JavaScript boolean, Lua boolean

Notes

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

see doesWeaponTakeWeaponComponent for full list of weapons & components

Reference

Namespace
Weapon WEAPON
In the game
BOOL HAS_WEAPON_GOT_WEAPON_COMPONENT(Object weapon, Hash componentHash)
Hash
0x76A18844E743BF91

Open in the interactive natives reference