WeaponClient

isPedArmed

IS_PED_ARMED0x475768A975D5AD17

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

SignatureJavaScript
isPedArmed(ped: Ped, typeFlags: number): boolean
SignatureLua
isPedArmed(ped: Ped, typeFlags: integer): boolean

Usage

JavaScript
const result = isPedArmed(ped, typeFlags);
Lua
local result = isPedArmed(ped, typeFlags)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
typeFlagsintnumberinteger

Returns

BOOL JavaScript boolean, Lua boolean

Notes

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

Checks if the ped is currently equipped with a weapon matching a bit specified using a bitwise-or in typeFlags.

Type flag bit values:
1 = Melee weapons
2 = Explosive weapons
4 = Any other weapons

Not specifying any bit will lead to the native *always* returning 'false', and for example specifying '4 | 2' will check for any weapon except fists and melee weapons.
7 returns true if you are equipped with any weapon except your fists.
6 returns true if you are equipped with any weapon except melee weapons.
5 returns true if you are equipped with any weapon except the Explosives weapon group.
4 returns true if you are equipped with any weapon except Explosives weapon group AND melee weapons.
3 returns true if you are equipped with either Explosives or Melee weapons (the exact opposite of 4).
2 returns true only if you are equipped with any weapon from the Explosives weapon group.
1 returns true only if you are equipped with any Melee weapon.
0 never returns true.

Note: When I say "Explosives weapon group", it does not include the Jerry can and Fire Extinguisher.

Reference

Namespace
Weapon WEAPON
In the game
BOOL IS_PED_ARMED(Ped ped, int typeFlags)
Hash
0x475768A975D5AD17

Open in the interactive natives reference