WeaponClient

giveWeaponComponentToWeaponObject

GIVE_WEAPON_COMPONENT_TO_WEAPON_OBJECT0x33E179436C0B31DB

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

SignatureJavaScript
giveWeaponComponentToWeaponObject(
  weaponObject: Object,
  componentHash: Hash
): void
SignatureLua
giveWeaponComponentToWeaponObject(weaponObject: Object, componentHash: Hash)

Usage

JavaScript
giveWeaponComponentToWeaponObject(weaponObject, componentHash);
Lua
giveWeaponComponentToWeaponObject(weaponObject, componentHash)

Parameters

ParameterTypeJavaScriptLua
weaponObjectObjectnumberinteger
componentHashHashnumberinteger

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

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

componentHash:
(use getWeaponComponentTypeModel() to get hash value)
${component_at_ar_flsh}, ${component_at_ar_supp}, ${component_at_pi_flsh}, ${component_at_scope_large}, ${component_at_ar_supp_02}

Reference

Namespace
Weapon WEAPON
In the game
void GIVE_WEAPON_COMPONENT_TO_WEAPON_OBJECT(Object weaponObject, Hash componentHash)
Hash
0x33E179436C0B31DB

Open in the interactive natives reference