GET_MAX_AMMO
Writes the maximum ammo the ped can carry for the weapon weaponHash to ammo. Returns true on success.
Signature
BOOL GET_MAX_AMMO(Ped ped, int* ammo, Hash weaponHash); // 0xDC16122C7A20C933 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | ped | Ped |
| 2 | ammo | int* (out pointer) |
| 3 | weaponHash | Hash |
Facts
| Name | GET_MAX_AMMO |
|---|---|
| Hash | 0xDC16122C7A20C933 |
| 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, ammo = Citizen.InvokeNative(0xDC16122C7A20C933, -- GET_MAX_AMMO
PlayerPedId(), -- Ped ped
Citizen.PointerValueInt(), -- int* ammo
GetHashKey("weapon_revolver_cattleman"), -- Hash weaponHash
Citizen.ReturnResultAnyway()
)
if result then
-- ...
endconst [result, ammo] = Citizen.invokeNative("0xDC16122C7A20C933", // GET_MAX_AMMO
PlayerPedId(), // Ped ped
Citizen.pointerValueInt(), // int* ammo
GetHashKey("weapon_revolver_cattleman"), // Hash weaponHash
Citizen.returnResultAnyway()
);
if (result) {
// ...
}var ammoArg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0xDC16122C7A20C933, // GET_MAX_AMMO
API.PlayerPedId(), // Ped ped
ammoArg, // int* ammo
(uint)API.GetHashKey("weapon_revolver_cattleman") // Hash weaponHash
);
int ammo = ammoArg.GetResult<int>();Related WEAPON natives
- GET_MAX_AMMO_IN_CLIP
- GET_AMMO_IN_CLIP
- GET_AMMO_IN_PED_WEAPON
- GET_PED_AMMO_BY_TYPE
- GET_PED_AMMO_TYPE_FROM_WEAPON
- _GET_AMMO_IN_CLIP_BY_INVENTORY_UID
- _GET_AMMO_IN_PED_WEAPON_FROM_GUID
- _GET_AMMO_RECOMMENDED_TYPE_FOR_WEAPON
- _GET_AMMO_TYPE_FOR_WEAPON
- _GET_CURRENT_AMMO_TYPE_FROM_GUID
- _GET_CURRENT_PED_WEAPON_AMMO_TYPE
- _GET_MAX_LOCKON_DISTANCE_OF_CURRENT_PED_WEAPON
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.