I'm working on a plugin that makes the Sandvich and G.R.U. each cut the Heavy's primary ammo in half. I've gotten everything sorted down to how to get the ammo-value I need, but I can't figure out how to apply it.
Here's the code that's meant to change the ammo of the minigun, found inside of TF2Items_OnGiveNamedItem():
PHP Code:
new type = GetEntProp(weapon, Prop_Send, "m_iPrimaryAmmoType");
SetEntProp(client, Prop_Data, "m_iAmmo", ammo, _, type);
I ripped that from
Advanced Infinite Ammo, but it doesn't seem to affect the minigun at all. The value 'ammo' changes how I need it to, according to my debug-messages, but the value in the UI still always says 200 (or 300, in Natascha's case).
What am I doing incorrectly?