getPedOriginalAmmoTypeFromWeapon
GET_PED_ORIGINAL_AMMO_TYPE_FROM_WEAPON0xF489B44DD5AF4BD9The 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.
getPedOriginalAmmoTypeFromWeapon(ped: Ped, weaponHash: Hash): HashgetPedOriginalAmmoTypeFromWeapon(ped: Ped, weaponHash: Hash): HashUsage
const hash = getPedOriginalAmmoTypeFromWeapon(ped, weaponHash);local hash = getPedOriginalAmmoTypeFromWeapon(ped, weaponHash)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
weaponHash | Hash | number | integer |
Returns
Hash JavaScript number, Lua integerA 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