(not sure if anyone really cares by now)
I've fixed a few bugs and added support for secondary ammo (it works in HL2: DM, no idea if it works in any other game).
The code - https://pastebin.com/muArTj40
I tried to make secondary ammo work with the same method as infinite primary ammo was implemented (figuring clipoffset
by FindSendPropInfo("CBaseCombatWeapon", "m_iClip1")
and then setting SetEntData(iWeapon, clipoffset, 50, 4, true)
) with m_iClip2
but had no success and then switched to "FindSendPropInfo("CBaseCombatWeapon", "m_iSecondaryAmmoType")"
. Probably not the cleanest method but it works.