WeaponClient

getPedAmmoByType

GET_PED_AMMO_BY_TYPE0x39D22031557946C1

The GTA V native GET_PED_AMMO_BY_TYPE of the WEAPON namespace, as LS:MP client scripts call it: the global function getPedAmmoByType, in JavaScript and in Lua.

SignatureJavaScript
getPedAmmoByType(ped: Ped, ammoTypeHash: Hash): number
SignatureLua
getPedAmmoByType(ped: Ped, ammoTypeHash: Hash): integer

Usage

JavaScript
const result = getPedAmmoByType(ped, ammoTypeHash);
Lua
local result = getPedAmmoByType(ped, ammoTypeHash)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
ammoTypeHashHashnumberinteger

Returns

int JavaScript number, Lua integer

Reference

Namespace
Weapon WEAPON
In the game
int GET_PED_AMMO_BY_TYPE(Ped ped, Hash ammoTypeHash)
Hash
0x39D22031557946C1

Open in the interactive natives reference