AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [CS:GO] Get max ammo (https://forums.alliedmods.net/showthread.php?t=280540)

gubka 03-18-2016 20:50

[CS:GO] Get max ammo
 
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) ]; 


TheWho 03-19-2016 14:01

Re: [CS:GO] Get max ammo
 
Thx, I remember somebody wrote an api for this :/

Neuro Toxin 03-19-2016 18:50

Re: [CS:GO] Get max ammo
 
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.

8guawong 03-20-2016 21:53

Re: [CS:GO] Get max ammo
 
Quote:

Originally Posted by TheWho (Post 2403942)
Thx, I remember somebody wrote an api for this :/

https://forums.alliedmods.net/showthread.php?t=279187


All times are GMT -4. The time now is 18:38.

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