Raised This Month: $ Target: $400
 0% 

[TF2] Gamedata: GetMaxAmmo / GetMaxClip


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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, 444 views)
File Type: inc weapondata.inc (4.4 KB, 391 views)
__________________

Last edited by Chdata; 06-08-2015 at 11:21.
Chdata 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 15:59.


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