WeaponClient

getPedOriginalAmmoTypeFromWeapon

GET_PED_ORIGINAL_AMMO_TYPE_FROM_WEAPON0xF489B44DD5AF4BD9

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

SignatureJavaScript
getPedOriginalAmmoTypeFromWeapon(ped: Ped, weaponHash: Hash): Hash
SignatureLua
getPedOriginalAmmoTypeFromWeapon(ped: Ped, weaponHash: Hash): Hash

Usage

JavaScript
const hash = getPedOriginalAmmoTypeFromWeapon(ped, weaponHash);
Lua
local hash = getPedOriginalAmmoTypeFromWeapon(ped, weaponHash)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger

Returns

Hash JavaScript number, Lua integer

A game hash. Natives return it unsigned (0 to 4294967295), the value lsmp.hash gives. As an argument, the signed and unsigned forms of a hash are the same value.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Returns the base/default ammo type of the specified ped's specified weapon.
Use getPedAmmoTypeFromWeapon if you want current ammo type (like AMMO_MG_INCENDIARY/AMMO_MG_TRACER while using MkII magazines) and use this if you want base ammo type. (AMMO_MG)
Full list of weapons by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/weapons.json

Reference

Namespace
Weapon WEAPON
In the game
Hash GET_PED_ORIGINAL_AMMO_TYPE_FROM_WEAPON(Ped ped, Hash weaponHash)
Hash
0xF489B44DD5AF4BD9
Introduced
Game build 1103 legacy numbering
Formerly
_GET_PED_AMMO_TYPE_FROM_WEAPON_2

Open in the interactive natives reference