isPedArmed
IS_PED_ARMED0x475768A975D5AD17The 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.
isPedArmed(ped: Ped, typeFlags: number): booleanisPedArmed(ped: Ped, typeFlags: integer): booleanUsage
const result = isPedArmed(ped, typeFlags);local result = isPedArmed(ped, typeFlags)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
typeFlags | int | number | integer |
Returns
BOOL JavaScript boolean, Lua booleanNotes
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