WeaponClient

setCurrentPedWeapon

SET_CURRENT_PED_WEAPON0xADF692B254977C0C

The 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.

SignatureJavaScript
setCurrentPedWeapon(ped: Ped, weaponHash: Hash, bForceInHand: boolean): void
SignatureLua
setCurrentPedWeapon(ped: Ped, weaponHash: Hash, bForceInHand: boolean)

Usage

JavaScript
setCurrentPedWeapon(ped, weaponHash, bForceInHand);
Lua
setCurrentPedWeapon(ped, weaponHash, bForceInHand)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger
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 SET_CURRENT_PED_WEAPON(Ped ped, Hash weaponHash, BOOL bForceInHand)
Hash
0xADF692B254977C0C

Open in the interactive natives reference