giveWeaponToPed
GIVE_WEAPON_TO_PED0xBF0FD6E56C964FCBThe 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.
giveWeaponToPed(
ped: Ped,
weaponHash: Hash,
ammoCount: number,
isHidden: boolean,
bForceInHand: boolean
): voidgiveWeaponToPed(
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
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
weaponHash | Hash | number | integer |
ammoCount | int | number | integer |
isHidden | BOOL | boolean | boolean |
bForceInHand | BOOL | boolean | boolean |
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 by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/weapons.json
Reference
- Namespace
- Weapon WEAPON
- In the game
void GIVE_WEAPON_TO_PED(Ped ped, Hash weaponHash, int ammoCount, BOOL isHidden, BOOL bForceInHand)- Hash
0xBF0FD6E56C964FCB