keybode

csgo external GetInaccuracy & GetSpread

Jul 19th, 2014
503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.48 KB | None | 0 0
  1. const float flConeStatic[ 50 ] =
  2. {
  3.     0.00f,  // 0    none
  4.     2.00f,  // 1    deagle
  5.     2.00f,  // 2    elite
  6.     2.00f,  // 3    fiveseven
  7.     2.00f,  // 4    glock
  8.     0.00f,  // 5    none
  9.     0.00f,  // 6    none
  10.     0.60f,  // 7    ak47
  11.     0.50f,  // 8    aug
  12.     0.20f,  // 9    awp
  13.     0.60f,  // 10   famas
  14.     0.30f,  // 11   g3sg1
  15.     0.00f,  // 12   none
  16.     0.60f,  // 13   galilar
  17.     2.00f,  // 14   m249
  18.     0.00f,  // 15   none
  19.     0.60f,  // 16   m4a1
  20.     1.00f,  // 17   mac10
  21.     0.00f,  // 18   none
  22.     1.00f,  // 19   p90
  23.     0.00f,  // 20   none
  24.     0.00f,  // 21   none
  25.     0.00f,  // 22   none
  26.     0.00f,  // 23   none
  27.     1.00f,  // 24   ump45
  28.     40.00f, // 25   xm1014
  29.     1.00f,  // 26   bizon
  30.     40.00f, // 27   mag7
  31.     2.00f,  // 28   negev
  32.     60.00f, // 29   sawedoff
  33.     2.00f,  // 30   tec9
  34.     2.00f,  // 31   tazer
  35.     2.00f,  // 32   hkp2000
  36.     1.00f,  // 33   mp7
  37.     0.75f,  // 34   mp9
  38.     40.00f, // 35   nova
  39.     2.00f,  // 36   p250
  40.     0.00f,  // 37   none
  41.     0.30f,  // 38   scar20
  42.     0.50f,  // 39   sg556
  43.     0.30f,  // 40   ssg08
  44.     0.00f,  // 41   none
  45.     0.00f,  // 42   none
  46.     0.00f,  // 43   none
  47.     0.00f,  // 44   none
  48.     0.00f,  // 45   none
  49.     0.00f,  // 46   none
  50.     0.00f,  // 47   none
  51.     0.00f,  // 48   none
  52.     0.00f,  // 49   none
  53. };
  54.  
  55. static float flInaccuracyMove[ 50 ] =
  56. {
  57.     0.00f,  // 0
  58.     48.10f, // 1
  59.     17.85f, // 2
  60.     13.41f, // 3
  61.     12.00f, // 4
  62.     0.00f,  // 5
  63.     0.00f,  // 6
  64.     175.06f,// 7
  65.     135.45f,// 8
  66.     176.48f,// 9
  67.     99.34f, // 10
  68.     150.48f,// 11
  69.     0.00f,  // 12
  70.     123.56f,// 13
  71.     156.25f,// 14
  72.     0.00f,  // 15
  73.     137.88f,// 16
  74.     24.99f, // 17
  75.     0.00f,  // 18
  76.     31.00f, // 19
  77.     0.00f,  // 20
  78.     0.00f,  // 21
  79.     0.00f,  // 22
  80.     0.00f,  // 23
  81.     28.76f, // 24
  82.     36.03f, // 25
  83.     27.57f, // 26
  84.     15.99f, // 27
  85.     159.14f,// 28
  86.     16.80f, // 29
  87.     13.81f, // 30
  88.     1.00f,  // 31
  89.     13.00f, // 32
  90.     39.86f, // 33
  91.     19.04f, // 34
  92.     36.75f, // 35
  93.     13.41f, // 36
  94.     0.00f,  // 37
  95.     150.48f,// 38
  96.     136.01f,// 39
  97.     123.45f,// 40
  98.     0.00f,  // 41
  99.     0.00f,  // 42
  100.     0.00f,  // 43
  101.     0.00f,  // 44
  102.     0.00f,  // 45
  103.     0.00f,  // 46
  104.     0.00f,  // 47
  105.     0.00f,  // 48
  106.     0.00f   // 49
  107. };
  108.  
  109. float CEntity::GetInaccuracy ( void )
  110. {
  111.     int weapon = hl2->read<int> ( m_baseWeaponPointer + HL2::NetVar::Weapon::m_fAccuracyPenalty + 0x1C );
  112.  
  113.     float cone = 0.0f;
  114.  
  115.     if ( m_velocity.Length2D () > 140.0f )
  116.         cone = flConeStatic[weapon] * 0.001000000047497451f;
  117.  
  118.     return cone;
  119. }
  120.  
  121. float CEntity::GetSpread ( void )
  122. {
  123.     int weapon = hl2->read<int> ( m_baseWeaponPointer + HL2::NetVar::Weapon::m_fAccuracyPenalty + 0x1C );
  124.  
  125.     float spread = hl2->read<float> ( m_baseWeaponPointer + HL2::NetVar::Weapon::m_fAccuracyPenalty );
  126.  
  127.     if ( m_velocity.Length2D () > 140.0f )
  128.         spread += flInaccuracyMove[weapon] * 0.001000000047497451f;
  129.  
  130.     return spread;
  131. }
Advertisement
Add Comment
Please, Sign In to add comment