// cstrike.inc:
//#define CS_SLOT_PRIMARY 0 /**< Primary weapon slot. */
//#define CS_SLOT_SECONDARY 1 /**< Secondary weapon slot. */
//#define CS_SLOT_KNIFE 2 /**< Knife slot. */
//#define CS_SLOT_GRENADE 3 /**< Grenade slot (will only return one grenade). */
//#define CS_SLOT_C4 4 /**< C4 slot. */
//#define CS_SLOT_BOOST 11 /**< Slot for healthshot and shield (will only return one weapon/item). */
//#define CS_SLOT_UTILITY 12 /**< Slot for tablet. */
int GetSlotByClassname(char[] cls)
{
if(cls[0] != 'w')
return -1;
switch(cls[7])
{
case 'a': // ak47, aug, awp, axe
return cls[8] == 'x' ? CS_SLOT_KNIFE : CS_SLOT_PRIMARY; // проверить слот
case 'b':
{
switch(cls[8])
{
case 'a': return CS_SLOT_KNIFE; // bayonet
case 'i': return CS_SLOT_PRIMARY; // bizon
case 'r': return CS_SLOT_; // breachcharge // проверить слот
case 'u': return CS_SLOT_; // bumpmine // проверить слот
}
}
case 'c': // c4, cz75a
return cls[8] == '4' ? CS_SLOT_C4 : CS_SLOT_SECONDARY;
case 'd': // deagle, decoy
return cls[9] == 'a' ? CS_SLOT_SECONDARY : CS_SLOT_GRENADE;
case 'e': // elite
return CS_SLOT_SECONDARY;
case 'f':
{
switch(cls[9])
{
case 'm': return CS_SLOT_PRIMARY; // famas
case 's': return CS_SLOT_KNIFE; // fists // проверить слот
case 'v': return CS_SLOT_SECONDARY; // fiveseven
case 'a': return CS_SLOT_GRENADE; // flashbang
}
}
case 'g': // g3sg1, galil, galilar, glock
return cls[8] == 'l' ? CS_SLOT_SECONDARY : CS_SLOT_PRIMARY;
{
}
case 'h':
{
switch(cls[9])
{
case 'm': return CS_SLOT_KNIFE; // hammer // проверить слот
case 'a': return CS_SLOT_BOOST; // healthshot
case 'g': return CS_SLOT_GRENADE; // hegrenade
case 'p': return CS_SLOT_SECONDARY; // hkp2000
}
}
case 'i': // incgrenade
return CS_SLOT_GRENADE;
case 'k': // knife*
return CS_SLOT_KNIFE;
case 'm':
{
switch(cls[8])
{
case 'e': return CS_SLOT_KNIFE; // melee // проверить слот
case 'o': return CS_SLOT_GRENADE; // molotov
default: return CS_SLOT_PRIMARY; // m249, m3, m4a1, m4a1_silencer, mac10, mag7, mp5navy, mp5sd, mp7, mp9
}
}
case 'n': // negev, nova
return CS_SLOT_PRIMARY;
case 'p': // p228, p250, p90
return cls[8] == '2' ? CS_SLOT_SECONDARY : CS_SLOT_PRIMARY;
case 'r': // revolver
return CS_SLOT_SECONDARY;
case 's':
{
switch(cls[8])
{
case 'h': return CS_SLOT_BOOST; // shield
case 'm': return CS_SLOT_GRENADE; // smokegrenade
case 'n': return CS_SLOT_; // snowball // проверить слот
case 'p': return CS_SLOT_; // spanner // проверить слот
default: return CS_SLOT_SECONDARY; // sawedoff, scar17, scar20, scout, sg550, sg552, sg556, ssg08
}
}
case 't': // tablet, tagrenade, taser, tec9 // проверить слот
{
switch(cls[9])
{
case 'b': return CS_SLOT_UTILITY; // tablet // проверить слот
case 'g': return CS_SLOT_GRENADE; // tagrenade // проверить слот
case 's': return CS_SLOT_KNIFE; // taser // проверить слот
case 'c': return CS_SLOT_SECONDARY; // tec9
case 'c': return CS_SLOT_PRIMARY; // tmp
}
}
case 'u': // ump45, usp, usp_silencer
return cls[8] == 'm' ? CS_SLOT_PRIMARY : CS_SLOT_SECONDARY;
case 'x': // xm1014
return CS_SLOT_PRIMARY;
/* case 'z': // zone_repulsor
return CS_SLOT_; // проверить слот
*/ }
return -1;
}