Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. void RCS::doRCS() {
  2.  
  3. bool b = false;
  4. Vector newViewAngles;
  5. Vector oldAimPunch;
  6. oldAimPunch.x = oldAimPunch.y = oldAimPunch.z = 0;
  7.  
  8.  
  9. while (true) {
  10.  
  11. if (cfg.rcs_enable == 1) {
  12.  
  13. if (((GetKeyState(VK_LBUTTON) & 0x80) != 0) && !b) {
  14. b = true;
  15.  
  16. }
  17. else if (((GetKeyState(VK_LBUTTON) & 0x80) == 0) && b) {
  18. b = false;
  19. }
  20.  
  21. DWORD localPlayer = memory.Read<DWORD>(Client + Offsets::dwLocalPlayer);
  22. Vector punch = memory.Read<Vector>(localPlayer + Offsets::m_vecPunch);
  23. DWORD shotsFired = memory.Read<DWORD>(localPlayer + Offsets::m_iShotsFired);
  24.  
  25.  
  26. if (shotsFired > 1 && b) {
  27.  
  28. float pos_x = cfg.rcs_x;
  29. float calculate_x = 2.f / 100;
  30. float p_x = calculate_x * pos_x;
  31.  
  32. float pos_y = cfg.rcs_y;
  33. float calculate_y = 2.f / 100;
  34. float p_y = calculate_y * pos_y;
  35.  
  36. if (pos_y > 100) {
  37. p_y = 2.f;
  38. }
  39.  
  40. if (pos_y < 0) {
  41. p_y = 0.f;
  42. }
  43.  
  44. if (pos_x > 100) {
  45. p_x = 2.f;
  46. }
  47.  
  48. if (pos_x < 0) {
  49. p_x = 0.f;
  50. }
  51.  
  52. DWORD clientState = memory.Read<DWORD>(Engine + Offsets::dwClientState);
  53. Vector currentViewAngles = memory.Read<Vector>(clientState + Offsets::dwClientState_ViewAngles);
  54. newViewAngles.x = ((currentViewAngles.x + oldAimPunch.x) - (punch.x * p_x));
  55. newViewAngles.y = ((currentViewAngles.y + oldAimPunch.y) - (punch.y * p_y));
  56. newViewAngles.z = 0;
  57.  
  58. while (newViewAngles.y > 180)
  59. newViewAngles.y -= 360; //360
  60.  
  61. while (newViewAngles.y < -180)
  62. newViewAngles.y += 360; //360
  63.  
  64. if (newViewAngles.x > 89.0f)
  65. newViewAngles.x = 89.0f; //89
  66.  
  67. if (newViewAngles.x < -89.0f)
  68. newViewAngles.x = -89.0f; //89
  69.  
  70. newViewAngles.z = 0;
  71.  
  72. oldAimPunch.x = punch.x * p_x;
  73. oldAimPunch.y = punch.y * p_y;
  74. oldAimPunch.z = 0;
  75.  
  76.  
  77. memory.Write<Vector>(clientState + Offsets::dwClientState_ViewAngles, newViewAngles);
  78. Sleep(1);
  79.  
  80. }
  81. else {
  82. oldAimPunch.x = oldAimPunch.y = oldAimPunch.z = 0;
  83. }
  84. }
  85.  
  86. Sleep(1);
  87.  
  88. }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement