View Single Post
Re: Getting the enemy's weapon-help plz
Old
  (#4)
jeefo
путинхуйлоебаное
 
jeefo's Avatar
 
Status: Offline
Posts: 453
Join Date: Nov 2005
Location: Saint-Petersburg
Default Re: Getting the enemy's weapon-help plz - 10-06-2006

np

Weapons:
PHP Code:
enum eWeapon
{
   
WEAPON_P228         1,
   
WEAPON_SHIELDGUN    2,
   
WEAPON_SCOUT        3,
   
WEAPON_HEGRENADE    4,
   
WEAPON_XM1014       5,
   
WEAPON_C4           6,
   
WEAPON_MAC10        7,
   
WEAPON_AUG          8,
   
WEAPON_SMOKEGRENADE 9,
   
WEAPON_ELITE        10,
   
WEAPON_FIVESEVEN    11,
   
WEAPON_UMP45        12,
   
WEAPON_SG550        13,
   
WEAPON_GALIL        14,
   
WEAPON_FAMAS        15,
   
WEAPON_USP          16,
   
WEAPON_GLOCK18      17,
   
WEAPON_AWP          18,
   
WEAPON_MP5NAVY      19,
   
WEAPON_M249         20,
   
WEAPON_M3           21,
   
WEAPON_M4A1         22,
   
WEAPON_TMP          23,
   
WEAPON_G3SG1        24,
   
WEAPON_FLASHBANG    25,
   
WEAPON_DEAGLE       26,
   
WEAPON_SG552        27,
   
WEAPON_AK47         28,
   
WEAPON_KNIFE        29,
   
WEAPON_P90          30,
   
WEAPON_ARMOR        31,
   
WEAPON_ARMORHELM    32,
   
WEAPON_DEFUSER      33
}; 
WEAPON_SHIELDGUN - is not a weapon, it's just added as helper.
To check if bot has shield use:
PHP Code:
bool CBot::HasShield (void)
{
   
// this function returns true, if bot has a tactical shield
   
   
return (strncmp (STRING (pev->viewmodel), "models/shield/v_shield_"23) == 0);
}

bool CBot::IsShieldDrawn (void)
{
   
// this function returns true, is the tactical shield is drawn
   
   
if (!HasShield ())
      return 
false;

   return ((
pev->weaponanim == 6) || (pev->weaponanim == 7));

pev = entvars_t structure.
  
Reply With Quote