Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct SCREEN_AIMBOT
- {
- #define SCREEN_INIT 0x10203040
- struct SCREEN_POINTS
- {
- float x;
- float y;
- };
- SCREEN_POINTS points[0x100];
- int count;
- float screenw;
- float screenh;
- DWORD init;
- void Init(float _screenw, float _screenh)
- {
- if (init == SCREEN_INIT)return;
- count = 0;
- screenw = _screenw;
- screenh = _screenh;
- init = SCREEN_INIT;
- }
- void Add(float x, float y)
- {
- if (init != SCREEN_INIT)return;
- if (count >= 0x100)return;
- points[count].x = x;
- points[count].y = y;
- count++;
- };
- void Free()
- {
- if (init != SCREEN_INIT)return;
- count = 0;
- };
- float Distance2D(float x1, float y1, float x2, float y2)
- {
- return sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
- }
- void Go(float speed)
- {
- if (init != SCREEN_INIT)return;
- float mindist = 99999.0;
- int index = -1;
- for (int i = 0; i<count; i++)
- {
- float dist = Distance2D(screenw / 2, screenh / 2, points[i].x, points[i].y);
- if (dist<mindist)
- {
- mindist = dist;
- index = i;
- };
- };
- if (index > -1)
- {
- float dx = (points[index].x - screenw / 2)*speed;
- float dy = (points[index].y - screenh / 2)*speed;
- ::mouse_event(MOUSEEVENTF_MOVE, dx, dy, 0, 0);
- }
- }
- } Aimbot;
- bool LWA = 0;
- if ((aim_key && aimtarget == (ULONGLONG)Player) || !aimtarget)
- {
- if (aimtarget == (ULONGLONG)Player)LWA = 1;
- }
- else goto exit_aim;
- float screenaim_w = aim_fov * 12;
- float screenaim_h = aim_fov * 12;
- float pos_x = w_h[0] - screenaim_w / 2;
- float pos_y = w_h[1] - screenaim_h / 2;
- float cx = BGUI::viewport.Width / 2;
- float cy = BGUI::viewport.Height / 2;
- float dscreen = w_h[0] - BGUI::viewport.Width / 2;
- if (aim_work)
- {
- if (LWA || cx > pos_x && cy > pos_y && cx < pos_x + screenaim_w && cy < pos_y + screenaim_h && !LWA)
- {
- if (LWA || abs(dscreen) < abs(min_dscreen))// && aim_priority == 0) || ((dist < mindist) && aim_priority == 1) && !LWA)
- {
- min_dscreen = dscreen;
- aims_pos_x = w_h[0];
- aims_pos_y = w_h[1] + 10;
- aimentity_adr = (ULONGLONG)Player;
- aim_update = true;
- }
- }
- }exit_aim:;
- if (aim_work && aim_update)
- {
- if (GetAsyncKeyState(MENU::enterkey_aimkey.key))
- {
- Aimbot.Add(aims_pos_x, aims_pos_y);
- Aimbot.Init(BGUI::viewport.Width, BGUI::viewport.Height);
- Aimbot.Go(aim_speed);
- Aimbot.Free();
- aimtarget = aimentity_adr;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement