setCurrentPedWeapon
SET_CURRENT_PED_WEAPON0xADF692B254977C0CThe GTA V native SET_CURRENT_PED_WEAPON of the WEAPON namespace, as LS:MP client scripts call it: the global function setCurrentPedWeapon, in JavaScript and in Lua.
setCurrentPedWeapon(ped: Ped, weaponHash: Hash, bForceInHand: boolean): voidsetCurrentPedWeapon(ped: Ped, weaponHash: Hash, bForceInHand: boolean)Usage
JavaScript
setCurrentPedWeapon(ped, weaponHash, bForceInHand);Lua
setCurrentPedWeapon(ped, weaponHash, bForceInHand)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
weaponHash | Hash | number | integer |
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 SET_CURRENT_PED_WEAPON(Ped ped, Hash weaponHash, BOOL bForceInHand)- Hash
0xADF692B254977C0C