Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. namespace AntiAims
  2. {
  3. // Pitches
  4. void StaticPitch(CUserCmd *pCmd, bool up)
  5. {
  6. if (up)
  7. // Up
  8. pCmd->viewangles.x = -88;
  9. else
  10. // Up
  11. pCmd->viewangles.x = 88;
  12. }
  13.  
  14. void JitterPitch(CUserCmd *pCmd)
  15. {
  16. static bool up = true;
  17. if (up) pCmd->viewangles.x = -180;
  18. else pCmd->viewangles.x = 180;
  19. up = !up;
  20. }
  21.  
  22. // Yaws
  23. void FastSpint(CUserCmd *pCmd)
  24. {
  25. int random = 160 + rand() % 40;
  26. static float current_y = pCmd->viewangles.y;
  27. current_y += random;
  28. pCmd->viewangles.y = current_y;
  29. }
  30.  
  31. void SlowSpin(CUserCmd *pCmd)
  32. {
  33. int random = rand() % 100;
  34. int random2 = rand() % 1000;
  35.  
  36. static bool dir;
  37. static float current_y = pCmd->viewangles.y;
  38.  
  39. if (random == 1) dir = !dir;
  40.  
  41. if (dir)
  42. current_y += 5;
  43. else
  44. current_y -= 5;
  45.  
  46. pCmd->viewangles.y = current_y;
  47.  
  48. if (random == random2)
  49. pCmd->viewangles.y += random;
  50.  
  51. }
  52.  
  53. void BackJitter(CUserCmd *pCmd)
  54. {
  55. int random = rand() % 100;
  56.  
  57. // Small chance of starting fowards
  58. if (random < 98)
  59. // Look backwards
  60. pCmd->viewangles.y -= 180;
  61.  
  62. // Some gitter
  63. if (random < 15)
  64. {
  65. float change = -70 + (rand() % (int)(140 + 1));
  66. pCmd->viewangles.y += change;
  67. }
  68. if (random == 69)
  69. {
  70. float change = -90 + (rand() % (int)(180 + 1));
  71. pCmd->viewangles.y += change;
  72. }
  73.  
  74. }
  75.  
  76. void Flip(CUserCmd *pCmd)
  77. {
  78. static bool back = false;
  79. back = !back;
  80. if (back)
  81. pCmd->viewangles.y -= 180;
  82. }
  83. }
  84.  
  85. // AntiAim
  86. void CRageBot::DoAntiAim(CUserCmd *pCmd)
  87. {
  88. // If the aimbot is doing something don't do anything
  89. if (IsAimStepping || pCmd->buttons & IN_ATTACK)
  90. return;
  91.  
  92. // Weapon shit
  93. CBaseCombatWeapon* pWeapon = (CBaseCombatWeapon*)Interfaces::EntList->GetClientEntityFromHandle(hackManager.pLocal()->GetActiveWeaponHandle());
  94. if (pWeapon)
  95. {
  96. CSWeaponInfo* pWeaponInfo = pWeapon->GetCSWpnData();
  97. // Knives or grenades
  98. if (!GameUtils::IsBallisticWeapon(pWeapon))
  99. return;
  100. }
  101.  
  102. // Don't do antiaim
  103. // if (DoExit) return;
  104.  
  105. // Anti-Aim Pitch
  106. switch (Menu::Window.RageBotTab.AntiAimPitch.GetIndex())
  107. {
  108. case 0:
  109. // No Pitch AA
  110. break;
  111. case 1:
  112. // up
  113. AntiAims::StaticPitch(pCmd, true);
  114. break;
  115. case 2:
  116. // Down
  117. AntiAims::StaticPitch(pCmd, false);
  118. break;
  119. case 3:
  120. // Jitter
  121. AntiAims::JitterPitch(pCmd);
  122. break;
  123. }
  124.  
  125. //Anti-Aim Yaw
  126. switch (Menu::Window.RageBotTab.AntiAimYaw.GetIndex())
  127. {
  128. case 0:
  129. // No Yaw AA
  130. break;
  131. case 1:
  132. // Fast Spin
  133. AntiAims::FastSpint(pCmd);
  134. break;
  135. case 2:
  136. // Slow Spin
  137. AntiAims::SlowSpin(pCmd);
  138. break;
  139. case 3:
  140. // Inverse
  141. pCmd->viewangles.y -= 180;
  142. break;
  143. case 4:
  144. // Jitter
  145. AntiAims::BackJitter(pCmd);
  146. break;
  147. case 5:
  148. // Flip
  149. AntiAims::Flip(pCmd);
  150. break;
  151. }
  152. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement