Instead of listing all offsets and then using a constant you can just use
const m_rgAmmo = 376 and
const m_iPrimaryAmmoType = 49. Then do:
PHP Code:
set_pdata_int(id, m_rgAmmo + get_pdata_int(ActiveItem, m_iPrimaryAmmoType, 4), ...)
.
ActiveItem can be retrieved by using get_pdata_cbase and m_pActiveItem.
__________________