Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit bf3348e

Browse files
committed
aimbot will now lock onto a person until the person is invisible/down/dead/or LocalPlayer stopped shooting
1 parent 845e0e9 commit bf3348e

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

Aimbot.cpp

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,36 @@ class Aimbot
1212
private:
1313
const int m_smoothing = 10;
1414
const int m_activationFOV = 7;
15+
Player *m_lockedOnPlayer = nullptr;
1516

1617
public:
1718
void update(Level *level, LocalPlayer *localPlayer, std::vector<Player *> *players, X11Utils *x11Utils)
1819
{
1920
// if (!x11Utils->triggerKeyDown())
21+
// {
22+
// m_lockedOnPlayer = nullptr;
2023
// return;
24+
// }
2125
if (!level->isPlayable())
26+
{
27+
m_lockedOnPlayer = nullptr;
2228
return;
29+
}
2330
if (localPlayer->isDead())
31+
{
32+
m_lockedOnPlayer = nullptr;
2433
return;
34+
}
2535
if (localPlayer->isKnocked())
36+
{
37+
m_lockedOnPlayer = nullptr;
2638
return;
39+
}
2740
if (!localPlayer->isInAttack())
41+
{
42+
m_lockedOnPlayer = nullptr;
2843
return;
44+
}
2945
double desiredViewAngleYaw = 0;
3046
double desiredViewAnglePitch = 0;
3147
if (level->isTrainingArea())
@@ -43,19 +59,20 @@ class Aimbot
4359
}
4460
else
4561
{
46-
Player *closestEnemy = findClosestEnemy(localPlayer, players);
47-
if (closestEnemy == nullptr)
62+
if (m_lockedOnPlayer == nullptr)
63+
m_lockedOnPlayer = findClosestEnemy(localPlayer, players);
64+
if (m_lockedOnPlayer == nullptr)
4865
return;
4966
desiredViewAngleYaw = calculateDesiredYaw(localPlayer->getLocationX(),
5067
localPlayer->getLocationY(),
51-
closestEnemy->getLocationX(),
52-
closestEnemy->getLocationY());
68+
m_lockedOnPlayer->getLocationX(),
69+
m_lockedOnPlayer->getLocationY());
5370
desiredViewAnglePitch = calculateDesiredPitch(localPlayer->getLocationX(),
5471
localPlayer->getLocationY(),
5572
localPlayer->getLocationZ(),
56-
closestEnemy->getLocationX(),
57-
closestEnemy->getLocationY(),
58-
closestEnemy->getLocationZ());
73+
m_lockedOnPlayer->getLocationX(),
74+
m_lockedOnPlayer->getLocationY(),
75+
m_lockedOnPlayer->getLocationZ());
5976
}
6077

6178
// Setup Pitch

0 commit comments

Comments
 (0)