allen343434

Untitled

May 29th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. void AimHead(LPDIRECT3DDEVICE9 pDevice, D3DXVECTOR3 HeadPos)
  2. {
  3. DWORD* pVTable = (DWORD*)pDevice;
  4. pVTable = (DWORD*)pVTable[0];
  5. ProxyCall<HRESULT>((void*)pVTable[48], 2, (void*)pClassManager.proxycalladdy, pDevice, &Tools.g_ViewPort);
  6.  
  7. DWORD ScreenCenterX = Tools.g_ViewPort.Width / 2;
  8. DWORD ScreenCenterY = Tools.g_ViewPort.Height / 2;
  9.  
  10. if (HeadPos.x != -1 && HeadPos.y != -1)
  11. {
  12. POINT Target;
  13.  
  14. if ((DWORD)HeadPos.x > (ScreenCenterX)) {
  15. Target.x = HeadPos.x - (ScreenCenterX);
  16. Target.x /= 4;
  17. Target.x = +Target.x;
  18. }
  19. if ((DWORD)HeadPos.x < (ScreenCenterX)) {
  20. Target.x = (ScreenCenterX - HeadPos.x);
  21. Target.x /= 4;
  22. Target.x = -Target.x;
  23. }
  24. if ((DWORD)HeadPos.x == (ScreenCenterX)) {
  25. Target.x = 0;
  26. }
  27. if ((DWORD)HeadPos.y >(ScreenCenterY)) {
  28. Target.y = HeadPos.y - (ScreenCenterY);
  29. Target.y /= 4;
  30. Target.y = +Target.y;
  31. }
  32. if ((DWORD)HeadPos.y < (ScreenCenterY)) {
  33. Target.y = (ScreenCenterY - HeadPos.y);
  34. Target.y /= 4;
  35. Target.y = -Target.y;
  36. }
  37. if ((DWORD)HeadPos.y == (ScreenCenterY)) {
  38. Target.y = 0;
  39. }
  40.  
  41. if (ProxyCall<SHORT>(&GetAsyncKeyState, 1, (void*)pClassManager.proxycalladdy, VK_LBUTTON))
  42. { }
  43. else
  44. {
  45. mouse_event(MOUSEEVENTF_LEFTDOWN, Target.x, Target.y, 0, 0);
  46. mouse_event(MOUSEEVENTF_LEFTUP, Target.x, Target.y, 0, 0);
  47. }
  48. }
  49. }
Add Comment
Please, Sign In to add comment