RedM Natives

GET_PED_AMMO_BY_TYPE

Hash0x39D22031557946C1
Runtime nameGetPedAmmoByType
NamespaceWEAPON
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x39D22031557946C1

Signature

int GET_PED_AMMO_BY_TYPE(Ped ped, Hash ammoType);

Parameters

NameTypeDescription
pedPed—
ammoTypeHash—

Returns int

Usage

Lua
local retval = GetPedAmmoByType(ped, ammoType)

-- always works, by hash
local retval = Citizen.InvokeNative(0x39D22031557946C1, ped, ammoType, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetPedAmmoByType(ped, ammoType);

// by hash
const retval = Citizen.invokeNative('0x39D22031557946C1', ped, ammoType, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0x39D22031557946C1, ped, ammoType);
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.

See also

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.