View Single Post
Author Message
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 05-10-2015 , 11:38   [TF2] Gamedata: GetMaxAmmo / GetMaxClip
Reply With Quote #1

Useful for anyone modding weapons or anything related to them.

This should also work for weapons with custom attributes and custom spawned weapons.

Anyway, TF2 doesn't seem to have a netprop or datamap for a weapon's max clip/ammo, meaning you have to use an SDKCall to GetMaxAmmo / GetMaxClip1 to get it. Maybe there's hidden ones really, but yeah.

It also properly accounts for mult_clip_size. I believe it returns -1 for energy weapons though. m_iClip1 will be -1 for energy weapons anyway. (Such as the Cow Mangler).

I also threw in GetDefaultClip (whatever that is) and GetSlot.

And well... see the attached files!

Oh, I only set it up for Linux/Mac, because I'm lazy.
Attached Files
File Type: txt weapon.data.txt (1,004 Bytes, 434 views)
File Type: inc weapondata.inc (4.4 KB, 385 views)
__________________

Last edited by Chdata; 06-08-2015 at 11:21.
Chdata is offline