Skip to content

Commit b2c6585

Browse files
authored
Create Aim_Move_To_Target_Point.cpp
1 parent 34c1c2e commit b2c6585

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

examples/Aim_Move_To_Target_Point.cpp

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
void AimMoveToTargetPoint(int bestPlayerIndex){
2+
if(bestPlayerIndex < 0) return;
3+
const float x = g_pEsp->Players[bestPlayerIndex].PositionHeader.x - g_pOverlay->screen_centerX;
4+
const float y = g_pEsp->Players[bestPlayerIndex].PositionHeader.y - g_pOverlay->screen_centerY;
5+
6+
std::async([](const float head_x, const float head_y){
7+
float dx = head_x;
8+
float dy = head_y;
9+
10+
INPUT input = { 0 };
11+
12+
input.mi.dx = dx * (dx > -10 && dx < 10 ? 0.1f : 0.5f);
13+
input.mi.dy = dy * (dy > -10 && dy < 10 ? 0.1f : 0.5f);
14+
15+
input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_VIRTUALDESK;
16+
input.type = INPUT_MOUSE;
17+
18+
SendInput(1, &input, sizeof INPUT);
19+
20+
21+
Sleep(1);
22+
23+
}, x, y);
24+
25+
}

0 commit comments

Comments
 (0)