Raised This Month: $51 Target: $400
 12% 

SDKCall CBaseCombatWeapon::GetMaxClip1(void)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 07-03-2014 , 07:15   SDKCall CBaseCombatWeapon::GetMaxClip1(void)
Reply With Quote #1

I became interested in this conversation and about psychonic answer.
Quote:
Originally Posted by Bubka3 View Post
I don't understand this. What I do understand is I'd have to figure out the default value for each gun which would be annoying at best.
Quote:
Originally Posted by psychonic View Post
Or do an SDKCall to GetMaxClip1 on the weapon.
I haven't use before any SDKCall and don't have knowledge how to set those parameters.
I could have just ask from @psychonic, "How to do it ? Show us !"
Instead of easier way to get answer, I search for it.

Require! Sticky: New IDA VTable Script
examples sm_getkey, GetEyePosition Example


SM plugin source code


- What I quick test, HL2DM, CS:S and DOD:S return right value.
- CSGO and TF2 instead return random value.

This is one method to get weapon max ammount ammo in Clip1.
Another way can be done also..
- when entity created, store in global variable weapon clip1 ammo.
- read weapon script file from server (loose file or inside VPK pack)
- use extensions

Hope one SDKCall tutorial more not cause disapproval
Attached Files
File Type: txt plugin.test.txt (438 Bytes, 206 views)
File Type: zip GetMaxClip1.zip (25.3 KB, 163 views)
Bacardi is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-03-2014 , 09:28   Re: SDKCall CBaseCombatWeapon::GetMaxClip1(void)
Reply With Quote #2

Did you check the return value of CBaseCombatWeapon::UsesClipsForAmmo1 before checking CBaseCombatWeapon::GetMaxClip1 / CBaseCombatWeapon::GetDefaultClip1?
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-03-2014 at 09:30.
Powerlord is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 07-03-2014 , 11:10   Re: SDKCall CBaseCombatWeapon::GetMaxClip1(void)
Reply With Quote #3

Quote:
Originally Posted by Powerlord View Post
Did you check the return value of CBaseCombatWeapon::UsesClipsForAmmo1 before checking CBaseCombatWeapon::GetMaxClip1 / CBaseCombatWeapon::GetDefaultClip1?
Nope. I was interested only this, GetMaxClip1 will return -1 if not use any ammo type. (Knife, grenades)

These can be check also with GetEntProp "m_iPrimaryAmmoType"
But if I remember rigth, grenades ammotype clip1 return as 255.

If you meant that ?

*edit
There is also Clip2 which HL2MP weapons use. Maybe dod also. And in cs:s mp5navy use both clip with same ammo (bug)

Last edited by Bacardi; 07-03-2014 at 19:54.
Bacardi is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 07-04-2014 , 05:41   Re: SDKCall CBaseCombatWeapon::GetMaxClip1(void)
Reply With Quote #4

Where did you find those functions?

I would be interested in using it, but they aren't listed in the vtable dumper I use http://www.sourcemodplugins.org/vtableoffsets/csgo

Maybe they just don't exist in CSGO
h3bus is offline
psychonic

BAFFLED
Join Date: May 2008
Old 07-04-2014 , 08:17   Re: SDKCall CBaseCombatWeapon::GetMaxClip1(void)
Reply With Quote #5

Quote:
Originally Posted by h3bus View Post
Where did you find those functions?

I would be interested in using it, but they aren't listed in the vtable dumper I use http://www.sourcemodplugins.org/vtableoffsets/csgo

Maybe they just don't exist in CSGO
They are in the weapon vtable. That site only shows the player vtable.
psychonic is offline
Bubka3
Sir Buzz Killington, Esq.
Join Date: Jan 2010
Location: New York, NY
Old 07-21-2014 , 15:17   Re: SDKCall CBaseCombatWeapon::GetMaxClip1(void)
Reply With Quote #6

Oh wow, glad I saw this -- I don't know how to do SDK calls
Bubka3 is offline
Reply



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 17:44.


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