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

[CSGO] SDKCalls


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HAWK0044
Junior Member
Join Date: Jul 2013
Old 07-24-2013 , 08:00   [CSGO] SDKCalls
Reply With Quote #1

Hey there . Do anybody help me with SDKcalls, I want to get weapon max ammo, and I use it:

PHP Code:
new Handle:m_hGetMaxClip;

SomeFunction()
{
new 
Handle:WeaponGameData LoadGameConfigFile("sm-cstrike.games");
StartPrepSDKCall(SDKCall_Entity);
PrepSDKCall_SetFromConf(WeaponGameDataSDKConf_Virtual"GetMaxClip1");
m_hGetMaxClip EndPrepSDKCall();

But when I calling function
SDKCall(m_hGetMaxClip, MaxAmmo);

I getting error. Description is something like this:
m_hGetMaxClip invalid handle 0. error 4.

Can anyone help me?
Thanks.
HAWK0044 is offline
mcpan313
Senior Member
Join Date: Mar 2010
Old 07-24-2013 , 09:23   Re: [CSGO] SDKCalls
Reply With Quote #2

Have you try this cvar?
PHP Code:
ammo_338mag_max ammo_357sig_max ammo_45acp_max ammo_50AE_max ammo_556mm_box_max ammo_556mm_max ammo_57mm_max ammo_762mm_max ammo_9mm_max ammo_buckshot_max 
__________________
sorry, for my poor english.
mcpan313 is offline
Send a message via MSN to mcpan313
HAWK0044
Junior Member
Join Date: Jul 2013
Old 07-24-2013 , 09:27   Re: [CSGO] SDKCalls
Reply With Quote #3

2mcpan313:
It's just max ammo in general, not into weapon magazine, and use cvars for getting weapon max clips is really poor.
____

Looks like I just have a bad offsets, server running on linux:

"GetMaxClip1"
{
"windows" "312"
"linux" "318"
}

Last edited by HAWK0044; 07-24-2013 at 09:27.
HAWK0044 is offline
mcpan313
Senior Member
Join Date: Mar 2010
Old 07-24-2013 , 10:19   Re: [CSGO] SDKCalls
Reply With Quote #4

this?
__________________
sorry, for my poor english.
mcpan313 is offline
Send a message via MSN to mcpan313
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 07-24-2013 , 10:36   Re: [CSGO] SDKCalls
Reply With Quote #5

Quote:
Originally Posted by mcpan313 View Post
this?
This doesn't return the max ammo.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
mcpan313
Senior Member
Join Date: Mar 2010
Old 07-24-2013 , 11:07   Re: [CSGO] SDKCalls
Reply With Quote #6

Quote:
Originally Posted by berni View Post
This doesn't return the max ammo.
Working fine.
Attached Thumbnails
Click image for larger version

Name:	20130724230515.jpg
Views:	297
Size:	78.0 KB
ID:	123078  
__________________
sorry, for my poor english.
mcpan313 is offline
Send a message via MSN to mcpan313
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 07-24-2013 , 11:24   Re: [CSGO] SDKCalls
Reply With Quote #7

that returns the value of clip1, not the max...

You can check out how I did it (with help from Peace-Maker) by looking at this plugin: https://forums.alliedmods.net/showthread.php?p=1612843

Of course, you'll have to get the correct offsets for CSGO
__________________
View my Plugins | Donate

Last edited by TnTSCS; 07-24-2013 at 11:31.
TnTSCS is offline
mcpan313
Senior Member
Join Date: Mar 2010
Old 07-24-2013 , 12:57   Re: [CSGO] SDKCalls
Reply With Quote #8

Quote:
Originally Posted by HAWK0044 View Post
2mcpan313:
It's just max ammo in general, not into weapon magazine, and use cvars for getting weapon max clips is really poor.
Why use cvars is really poor.


And GiveAmmo offset:
PHP Code:
"Games"
{
    
"csgo"
    
{
        
"Offsets"
        
{
            
// http://www.sourcemodplugins.org/vtableoffsets/csgo
            // CBaseCombatCharacter::GiveAmmo(int, int, bool)
            
"GiveAmmo"
            
{
                
"windows"        "270"
                "linux"        "271"
                "mac"        "271"
            
}
        }
    }

Attached Thumbnails
Click image for larger version

Name:	20130725005019.jpg
Views:	121
Size:	38.1 KB
ID:	123084  
__________________
sorry, for my poor english.
mcpan313 is offline
Send a message via MSN to mcpan313
HAWK0044
Junior Member
Join Date: Jul 2013
Old 07-24-2013 , 17:39   Re: [CSGO] SDKCalls
Reply With Quote #9

2mcpan313
Your example shows how to get ammo in the back and in the magazine, but it's doesn't contains anything about maximum clips in the magazine.

For example:
Ak47 has 30 clips in the magazine.
Desert eagle has 7 clips in the magazine.

Using cvars for me is really poor, because I wrote C/C++ code and made a raw mods for GoldSource engine.

Last edited by HAWK0044; 07-24-2013 at 17:41.
HAWK0044 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 10:24.


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