All pastes #73490 Raw Edit

Unnamed

public text v1 · immutable
#73490 ·published 2006-06-27 22:10 UTC
rendered paste body
int HLStatsIngame::GetWeaponIndex(const char *WeaponName)
{
	for(int i=1;i<MAX_WEAPONS;i++)	
	{
		if(i >= g_WeaponListCount) // This is a new weapon we add it
		{
			_snprintf(g_sWeaponList[i],MAX_WEAPONNAMELEN,"%s",WeaponName);
			g_WeaponListCount++;
			return i;
		}
		if(strcmp(WeaponName,g_sWeaponList[i]) == 0)
			return i;
	}
	return -1;
}
char* HLStatsIngame::GetWeaponName(int WeaponIndex)
{
	if(WeaponIndex >= g_WeaponListCount)
		return "Error";
	return g_sWeaponList[WeaponIndex];
}