WeaponClient1 output

getCurrentPedWeapon

GET_CURRENT_PED_WEAPON0x3A87E44BB9A01D54

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

SignatureJavaScript
getCurrentPedWeapon(ped: Ped, doDeadCheck: boolean): [
  ok: boolean,
  weaponHash: Hash
]
SignatureLua
getCurrentPedWeapon(ped: Ped, doDeadCheck: boolean): boolean, Hash

Usage

JavaScript
const [ok, weaponHash] = getCurrentPedWeapon(ped, doDeadCheck);
Lua
local ok, weaponHash = getCurrentPedWeapon(ped, doDeadCheck)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
doDeadCheckBOOLbooleanboolean

Returns

2 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1okBOOLbooleanbooleanThe native’s own return value.
2weaponHashHashnumberintegeroutput

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Returns true if the hash of the equipped weapon object equals the weapon hash.
doDeadCheck does nothing in release builds.

Reference

Namespace
Weapon WEAPON
In the game
BOOL GET_CURRENT_PED_WEAPON(Ped ped, Hash* weaponHash, BOOL doDeadCheck)
Hash
0x3A87E44BB9A01D54

Open in the interactive natives reference