HAS_PED_GOT_WEAPON
Returns true if the ped has the weapon weaponHash.
Signature
BOOL HAS_PED_GOT_WEAPON(Ped ped, Hash weaponHash, int p2, BOOL onlyCheckPlayerInventory); // 0x8DECB02F88F428BC b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | ped | Ped |
| 2 | weaponHash | Hash |
| 3 | p2 | int |
| 4 | onlyCheckPlayerInventory | BOOL |
Facts
| Name | HAS_PED_GOT_WEAPON |
|---|---|
| Hash | 0x8DECB02F88F428BC |
| Namespace | |
| Returns | BOOL |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
local result = Citizen.InvokeNative(0x8DECB02F88F428BC, -- HAS_PED_GOT_WEAPON
PlayerPedId(), -- Ped ped
GetHashKey("weapon_revolver_cattleman"), -- Hash weaponHash
0, -- int p2
false -- BOOL onlyCheckPlayerInventory
)
if result then
-- ...
endconst result = Citizen.invokeNative("0x8DECB02F88F428BC", // HAS_PED_GOT_WEAPON
PlayerPedId(), // Ped ped
GetHashKey("weapon_revolver_cattleman"), // Hash weaponHash
0, // int p2
false, // BOOL onlyCheckPlayerInventory
Citizen.returnResultAnyway()
);
if (result) {
// ...
}bool result = Function.Call<bool>((Hash)0x8DECB02F88F428BC, // HAS_PED_GOT_WEAPON
API.PlayerPedId(), // Ped ped
(uint)API.GetHashKey("weapon_revolver_cattleman"), // Hash weaponHash
0, // int p2
false // BOOL onlyCheckPlayerInventory
);Related WEAPON natives
- HAS_WEAPON_GOT_WEAPON_COMPONENT
- _HAS_PED_GOT_WEAPON_COMPONENT
- _GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION
- HIDE_PED_WEAPON_FOR_SCRIPTED_CUTSCENE
- _CLEAR_PED_LAST_WEAPON_DAMAGE
- _DISABLE_AMMO_TYPE_FOR_PED_WEAPON
- _ENABLE_AMMO_TYPE_FOR_PED_WEAPON
- _GET_AMMO_IN_PED_WEAPON_FROM_GUID
- _GET_BEST_PED_WEAPON_IN_GROUP
- _GET_BEST_PED_WEAPON_IN_INVENTORY
- _GET_CURRENT_PED_WEAPON_AMMO_TYPE
- _GET_DEFAULT_PED_WEAPON_COLLECTION
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.