_IS_PED_HOLDING_WEAPON
Weapon must currently be held/equipped by the ped.
0x07E1C35F0078C3F9IsPedHoldingWeaponSignature
BOOL _IS_PED_HOLDING_WEAPON(Ped ped, Hash weapon);Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | — |
weapon | Hash | — |
Returns BOOL
Description
Seems to return true if the passed weapon is some sort of non-lethal melee weapon.
Weapon must currently be held/equipped by the ped.
Returns whether the specified ped is holding a weapon with the given hash.
only these weapons below return true
WEAPON_BOW, WEAPON_KIT_METAL_DETECTOR, WEAPON_MELEE_CLEAVER, WEAPON_MELEE_DAVY_LANTERN, WEAPON_MELEE_HATCHET, WEAPON_MELEE_HATCHET_HUNTER, WEAPON_MELEE_KNIFE_JAWBONE, WEAPON_MELEE_LANTERN WEAPON_MELEE_TORCH, WEAPON_MOONSHINEJUG_MP, WEAPON_RIFLE_BOLTACTION, WEAPON_SHOTGUN_PUMP, WEAPON_THROWN_BOLAS, WEAPON_THROWN_MOLOTOV
Usage
local retval = IsPedHoldingWeapon(ped, weapon)
-- always works, by hash
local retval = Citizen.InvokeNative(0x07E1C35F0078C3F9, ped, weapon, Citizen.ReturnResultAnyway())JavaScript and C#
const retval = IsPedHoldingWeapon(ped, weapon);
// by hash
const retval = Citizen.invokeNative('0x07E1C35F0078C3F9', ped, weapon, Citizen.returnResultAnyway());bool retval = Function.Call<bool>((Hash)0x07E1C35F0078C3F9, ped, weapon);- Hash parameters: the named function also accepts a string and hashes it for you;
Citizen.InvokeNativeneeds the number — passjoaat("name")or a backtick literal like`name`. - The name is a community guess and may change. If the named call is missing in your client build, use
InvokeNativewith the hash — it always works.
Sources
alloc8or RDR3 NativeDB · VORPCORE RDR3natives
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.