Advertisement
keybode

css v34 CCSWeaponInfo

Feb 10th, 2015
632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. class CCSWeaponInfo {
  2. public:
  3.     unsigned char   __pad0[0x658];
  4.     WeaponType_t    m_WeaponType;
  5.     unsigned char   __pad1[0x8];
  6.     float           m_flArmorRatio;
  7.     unsigned char   __pad2[0x174];
  8.     int             m_iPenetration;
  9.     int             m_iDamage;
  10.     float           m_flRange;
  11.     float           m_flRangeModifier;
  12.     int             m_iBullets;
  13.     float           m_flCycleTime;
  14.  
  15.     bool            m_bAccuracyQuadratic;
  16.     float           m_flAccuracyDivisor;
  17.     float           m_flAccuracyOffset;
  18.     float           m_flMaxInaccuracy;
  19. };
  20.  
  21. float fAccuracy = GetAccuracy();
  22.  
  23. CCSWeaponInfo Weapon = pShared->pWeapon->GetWeaponInfo();
  24.  
  25. if (Weapon.m_flAccuracyDivisor != -1) {
  26.     int iShotsFired = pShared->pEntity->GetShotsFired();
  27.  
  28.     if (Weapon.m_bAccuracyQuadratic)
  29.         iShotsFired = iShotsFired * iShotsFired;
  30.     else
  31.         iShotsFired = iShotsFired * iShotsFired * iShotsFired;
  32.  
  33.     fAccuracy = (iShotsFired / Weapon.m_flAccuracyDivisor) + Weapon.m_flAccuracyOffset;
  34.  
  35.     if (fAccuracy > Weapon.m_flMaxInaccuracy)
  36.         fAccuracy = Weapon.m_flMaxInaccuracy;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement