I have the following that list out each item a player has in their inventory
but it doesn't give me a count and
even if they have two of something
it only prints out once so I can't do a count on them.
How would I for example get the number of healthshots a player has?
tx
PHP Code:
int arraysize = GetEntPropArraySize(client, Prop_Send, "m_hMyWeapons");
for(int x = 0; x < arraysize; x++)
{
entity = GetEntPropEnt(client, Prop_Send, "m_hMyWeapons", x);
if(entity != -1)
{
GetEntityClassname(entity, classname, sizeof(classname));
PrintToServer("iNVENTORY iTEM = %s", classname);
CS_GetTranslatedWeaponAlias(classname, classname, sizeof(classname));
CSWeaponID weaponID = CS_AliasToWeaponID(classname);
if(weaponID == CSWeapon_HEALTHSHOT)
PrintToServer("INVENTORY iTEM = %s", classname);
}
}