WeaponClient

giveWeaponToPed

GIVE_WEAPON_TO_PED0xBF0FD6E56C964FCB

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

SignatureJavaScript
giveWeaponToPed(
  ped: Ped,
  weaponHash: Hash,
  ammoCount: number,
  isHidden: boolean,
  bForceInHand: boolean
): void
SignatureLua
giveWeaponToPed(
  ped: Ped,
  weaponHash: Hash,
  ammoCount: integer,
  isHidden: boolean,
  bForceInHand: boolean
)

Usage

JavaScript
giveWeaponToPed(ped, weaponHash, ammoCount, isHidden, bForceInHand);
Lua
giveWeaponToPed(ped, weaponHash, ammoCount, isHidden, bForceInHand)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger
ammoCountintnumberinteger
isHiddenBOOLbooleanboolean
bForceInHandBOOLbooleanboolean

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.

Reference

Namespace
Weapon WEAPON
In the game
void GIVE_WEAPON_TO_PED(Ped ped, Hash weaponHash, int ammoCount, BOOL isHidden, BOOL bForceInHand)
Hash
0xBF0FD6E56C964FCB

Open in the interactive natives reference