Raised This Month: $ Target: $400
 0% 

[CS:GO] Get max ammo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gubka
Veteran Member
Join Date: Jan 2012
Location: Russia
Old 03-18-2016 , 20:50   [CS:GO] Get max ammo
Reply With Quote #1

May be somebody need this

PHP Code:
/**
 * Max amount of ammo for weapon.
 **/
static int CS_WeaponMaxAmmo[56] = 
{
    -
1,20,120,90,-1,32,-1,100,90,-1,120,100,100,90,90,90,52,30,120,200,32,40,120,90,-1,35,90,90,-1,100,-1,-1,-1,-1,90,120,32,200,32,120,-1,52,120,120,32,12,90,90,90,90,-1,-1,-1,-1,-1
};

// Get player weapon
                    
char szWeapon[NORMAL_LINE_LENGTH];
                    
GetEntityClassname(iWeaponszWeaponsizeof(szWeapon) );
                    
ReplaceString(szWeaponsizeof(szWeapon), "weapon_""");
                    
                    
// Initialize max ammo amount
                    
int iMaxAmmo CS_WeaponMaxAmmoCS_AliasToWeaponID(szWeapon) ]; 
__________________
gubka is offline
Send a message via ICQ to gubka
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 03-19-2016 , 14:01   Re: [CS:GO] Get max ammo
Reply With Quote #2

Thx, I remember somebody wrote an api for this :/
TheWho is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 03-20-2016 , 21:53   Re: [CS:GO] Get max ammo
Reply With Quote #3

Quote:
Originally Posted by TheWho View Post
Thx, I remember somebody wrote an api for this :/
https://forums.alliedmods.net/showthread.php?t=279187
__________________
8guawong is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 03-19-2016 , 18:50   Re: [CS:GO] Get max ammo
Reply With Quote #4

If Valve change a weapons ammo or add a new weapon this will require updates.

Your best to read the weapon scripts and items script and store the data into an array.
__________________
Neuro Toxin 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 18:38.


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