ryonadv

Untitled

Oct 5th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1. void CESP::Aimbot(void)
  2. {
  3. if (GetAsyncKeyState(0x02))
  4. {
  5. for (int i = 1; i < 130; i++)
  6. {
  7. if (Functions.Distance(Matrix[0].Position, Matrix[i].Position) < 1000)
  8. {
  9. D3DXVECTOR3 footPosition, footScreen, headPosition, headScreen;
  10.  
  11. footPosition.x = Matrix[i].Position.x;
  12. footPosition.y = Matrix[i].Position.y;
  13. footPosition.z = Matrix[i].Position.z - 1.0;
  14.  
  15. headPosition.x = Matrix[i].Position.x;
  16. headPosition.y = Matrix[i].Position.y;
  17. headPosition.z = Matrix[i].Position.z + 0.9;
  18.  
  19. if (Functions.WorldToScreen(&footPosition, &footScreen) && Functions.WorldToScreen(&headPosition, &headScreen))
  20. {
  21. int Height = footScreen.y - headScreen.y;
  22. int Width = Height / 2.5;
  23.  
  24. int CrosshairX, CrosshairY;
  25.  
  26. CrosshairX = DirectX.Width / 1.885;
  27. CrosshairY = DirectX.Height / 2.50;
  28.  
  29. if (Functions.WeaponSlot[0] == 6)
  30. {
  31. CrosshairX = DirectX.Center.x;
  32. CrosshairY = DirectX.Center.y;
  33. }
  34.  
  35. float Difference, Smooth;
  36.  
  37. if ((CrosshairX > headScreen.x - (Width * 2) && CrosshairX < headScreen.x + (Width * 2)) && (CrosshairY > headScreen.y && CrosshairY < headScreen.y + Height))
  38. {
  39. if (Menu.Items[CHEAT_AIMBOT].Value)
  40. {
  41. if (Menu.Items[CHEAT_AUTOSHOT].Value)
  42. CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Shot, 0, 0, 0);
  43.  
  44. DWORD KameraX = 0xB6F9CC;
  45. DWORD KameraY = 0xB6F9D0;
  46.  
  47. float * ViewX = (float*)0xB6F258;
  48.  
  49. D3DXVECTOR3 Position, Camera;
  50.  
  51. Camera.x = *(float*)KameraX;
  52. Camera.y = *(float*)KameraY;
  53.  
  54. Position.x = Camera.x - headPosition.x;
  55. Position.y = Camera.y - headPosition.y;
  56.  
  57. if (Functions.WeaponSlot[0] == 6)
  58. {
  59. Position.x = Matrix[0].Position.x - headPosition.x;
  60. Position.y = Matrix[0].Position.y - headPosition.y;
  61. }
  62.  
  63. float Dist = sqrt((Position.x * Position.x) + (Position.y * Position.y));
  64. float One = acosf(Position.x / Dist);
  65.  
  66. if (Position.x <= 0.0 && Position.y >= 0.0 || Position.x >= 0.0 && Position.y >= 0.0)
  67. {
  68. if (Functions.WeaponSlot[0] == 6)
  69. Difference = (One)-*ViewX;
  70. else
  71. Difference = (One + 0.0390) - *ViewX;
  72.  
  73. }
  74.  
  75. if (Position.x >= 0.0 && Position.y <= 0.0 || Position.x <= 0.0 && Position.y <= 0.0)
  76. {
  77. if (Functions.WeaponSlot[0] == 6)
  78. Difference = (-One) - *ViewX;
  79. else
  80. Difference = (-One + 0.0390) - *ViewX;
  81. }
  82.  
  83. Smooth = Difference / Menu.Items[CHEAT_SMOOTH].Value;
  84.  
  85. if (Smooth > -1.0 && Smooth < 0.5 && Difference > -2.0 && Difference < 2.0)
  86. *ViewX += Smooth;
  87. }
  88. }
  89. }
  90. }
  91. }
  92. }
  93. }
Add Comment
Please, Sign In to add comment