Raised This Month: $ Target: $400
 0% 

[TF2] Set Minigun Ammo


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Alfonso Crawford
Member
Join Date: Feb 2012
Old 03-20-2014 , 20:09   [TF2] Set Minigun Ammo
Reply With Quote #1

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(weaponProp_Send"m_iPrimaryAmmoType");
SetEntProp(clientProp_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?

Last edited by Alfonso Crawford; 03-20-2014 at 20:09.
Alfonso Crawford is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode