We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 442c138 commit 34c1c2eCopy full SHA for 34c1c2e
examples/Aim_Find_Best_Target.cpp
@@ -0,0 +1,18 @@
1
+int AimFindBestTarget(){
2
+ float targetDistance = 9999.0;
3
+
4
+ int bestPlayerIndex = -1;
5
6
+ for(int i = 0; i < MAX_PLAYERS; i++){
7
+ if(g_pEsp->Players[i].health > 0 && !g_pEsp->Players[i].isAlly && g_pEsp->Players[i].inList && g_pEsp->Players[i].isInScreen){
8
+ g_pEsp->Players[i].ReadCoordOrigin();
9
+ if(g_pEsp->Players[i].distanceCross < 30.f && g_pEsp->Players[i].distanceCross > 0.0f){
10
+ if(g_pEsp->Players[i].distanceCross < targetDistance){
11
+ bestPlayerIndex = i;
12
+ targetDistance = g_pEsp->Players[i].distanceCross;
13
+ }
14
15
16
17
+ return bestPlayerIndex;
18
+}
0 commit comments