Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void AimHead(LPDIRECT3DDEVICE9 pDevice, D3DXVECTOR3 HeadPos)
- {
- DWORD* pVTable = (DWORD*)pDevice;
- pVTable = (DWORD*)pVTable[0];
- ProxyCall<HRESULT>((void*)pVTable[48], 2, (void*)pClassManager.proxycalladdy, pDevice, &Tools.g_ViewPort);
- DWORD ScreenCenterX = Tools.g_ViewPort.Width / 2;
- DWORD ScreenCenterY = Tools.g_ViewPort.Height / 2;
- if (HeadPos.x != -1 && HeadPos.y != -1)
- {
- POINT Target;
- if ((DWORD)HeadPos.x > (ScreenCenterX)) {
- Target.x = HeadPos.x - (ScreenCenterX);
- Target.x /= 4;
- Target.x = +Target.x;
- }
- if ((DWORD)HeadPos.x < (ScreenCenterX)) {
- Target.x = (ScreenCenterX - HeadPos.x);
- Target.x /= 4;
- Target.x = -Target.x;
- }
- if ((DWORD)HeadPos.x == (ScreenCenterX)) {
- Target.x = 0;
- }
- if ((DWORD)HeadPos.y >(ScreenCenterY)) {
- Target.y = HeadPos.y - (ScreenCenterY);
- Target.y /= 4;
- Target.y = +Target.y;
- }
- if ((DWORD)HeadPos.y < (ScreenCenterY)) {
- Target.y = (ScreenCenterY - HeadPos.y);
- Target.y /= 4;
- Target.y = -Target.y;
- }
- if ((DWORD)HeadPos.y == (ScreenCenterY)) {
- Target.y = 0;
- }
- if (ProxyCall<SHORT>(&GetAsyncKeyState, 1, (void*)pClassManager.proxycalladdy, VK_LBUTTON))
- { }
- else
- {
- mouse_event(MOUSEEVENTF_LEFTDOWN, Target.x, Target.y, 0, 0);
- mouse_event(MOUSEEVENTF_LEFTUP, Target.x, Target.y, 0, 0);
- }
- }
- }
Add Comment
Please, Sign In to add comment