WeaponClient

giveWeaponComponentToPed

GIVE_WEAPON_COMPONENT_TO_PED0xD966D51AA5B28BB9

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

SignatureJavaScript
giveWeaponComponentToPed(
  ped: Ped,
  weaponHash: Hash,
  componentHash: Hash
): void
SignatureLua
giveWeaponComponentToPed(ped: Ped, weaponHash: Hash, componentHash: Hash)

Usage

JavaScript
giveWeaponComponentToPed(ped, weaponHash, componentHash);
Lua
giveWeaponComponentToPed(ped, weaponHash, componentHash)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger
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.

Full list of weapons & components by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/weapons.json

Reference

Namespace
Weapon WEAPON
In the game
void GIVE_WEAPON_COMPONENT_TO_PED(Ped ped, Hash weaponHash, Hash componentHash)
Hash
0xD966D51AA5B28BB9

Open in the interactive natives reference