GET_CURRENT_PED_WEAPON
Writes the hash of the ped's current weapon at the given attach point to weaponHash. Returns true if the ped has one.
Signature
BOOL GET_CURRENT_PED_WEAPON(Ped ped, Hash* weaponHash, BOOL p2, int attachPoint, BOOL p4); // 0x3A87E44BB9A01D54 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | ped | Ped |
| 2 | weaponHash | Hash* (out pointer) |
| 3 | p2 | BOOL |
| 4 | attachPoint | int |
| 5 | p4 | BOOL |
Facts
| Name | GET_CURRENT_PED_WEAPON |
|---|---|
| Hash | 0x3A87E44BB9A01D54 |
| 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, weaponHash = Citizen.InvokeNative(0x3A87E44BB9A01D54, -- GET_CURRENT_PED_WEAPON
PlayerPedId(), -- Ped ped
Citizen.PointerValueInt(), -- Hash* weaponHash
false, -- BOOL p2
0, -- int attachPoint
false, -- BOOL p4
Citizen.ReturnResultAnyway()
)
if result then
-- ...
endconst [result, weaponHash] = Citizen.invokeNative("0x3A87E44BB9A01D54", // GET_CURRENT_PED_WEAPON
PlayerPedId(), // Ped ped
Citizen.pointerValueInt(), // Hash* weaponHash
false, // BOOL p2
0, // int attachPoint
false, // BOOL p4
Citizen.returnResultAnyway()
);
if (result) {
// ...
}var weaponHashArg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0x3A87E44BB9A01D54, // GET_CURRENT_PED_WEAPON
API.PlayerPedId(), // Ped ped
weaponHashArg, // Hash* weaponHash
false, // BOOL p2
0, // int attachPoint
false // BOOL p4
);
int weaponHash = weaponHashArg.GetResult<int>();Related WEAPON natives
- GET_CURRENT_PED_WEAPON_ENTITY_INDEX
- GET_CURRENT_PED_VEHICLE_WEAPON
- _GET_CURRENT_PED_WEAPON_AMMO_TYPE
- _GET_MAX_LOCKON_DISTANCE_OF_CURRENT_PED_WEAPON
- _GET_PED_CURRENT_HELD_WEAPON
- _GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION
- GET_AMMO_IN_PED_WEAPON
- GET_BEST_PED_WEAPON
- GET_PED_AMMO_TYPE_FROM_WEAPON
- GET_PED_BACKUP_WEAPON
- GET_PED_LAST_WEAPON_IMPACT_COORD
- GET_PED_WEAPON_GUID_AT_ATTACH_POINT
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.