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(iWeapon, szWeapon, sizeof(szWeapon) );
ReplaceString(szWeapon, sizeof(szWeapon), "weapon_", "");
// Initialize max ammo amount
int iMaxAmmo = CS_WeaponMaxAmmo[ CS_AliasToWeaponID(szWeapon) ];