void CalcAngle(Vector2 &src, Vector2 &dst, Vector2 &angles)
{
double delta[3] = { (src.x - dst.x), (src.y - dst.y), (src.z - dst.z) };
double hyp = sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
angles.x = (float)(asinf(delta[2] / hyp) * 57.295779513082f);
angles.y = (float)(atanf(delta[1] / delta[0]) * 57.295779513082f);
angles.z = 0.0f;
if (delta[0] >= 0.0)
{
angles.x += 180.0f;
}
}
void SmoothAngles(Vector2 &ang, float smooth) {
if (smooth > 0) {
float a_fixAng = ang.y, p_fixAng = MyPlayer.CurrentViewAngles.y, distance = 0;
if (ang.y < 0) {
a_fixAng = 360 + ang.y;
}
if (MyPlayer.CurrentViewAngles.y < 0) {
p_fixAng = 360 + MyPlayer.CurrentViewAngles.y;
}
distance = min(abs(a_fixAng - p_fixAng), 360 - abs(a_fixAng - p_fixAng));
if (MyPlayer.CurrentViewAngles.y > 90 && ang.y < -90) {
ang.x = MyPlayer.CurrentViewAngles.x + (ang.x - MyPlayer.CurrentViewAngles.x) / smooth;
ang.y = MyPlayer.CurrentViewAngles.y + distance / smooth;
if (ang.y > 180.f) {
ang.y = -360 + ang.y;
}
return;
}
if (MyPlayer.CurrentViewAngles.y < -90 && ang.y > 90) {
ang.x = MyPlayer.CurrentViewAngles.x + (ang.x - MyPlayer.CurrentViewAngles.x) / smooth;
ang.y = MyPlayer.CurrentViewAngles.y - distance / smooth;
if (ang.y < -180.f) {
ang.y = 360 + ang.y;
}
return;
}
ang.x = MyPlayer.CurrentViewAngles.x + (ang.x - MyPlayer.CurrentViewAngles.x) / smooth;
ang.y = MyPlayer.CurrentViewAngles.y + (ang.y - MyPlayer.CurrentViewAngles.y) / smooth;
}
return;
}
bool ValidTarget(int vTarget, int vFov) {
if (vTarget == 0) {
return false;
}
if (vTarget > 32) {
return false;
}
if (PlayerList[vTarget].Team == MyPlayer.Team) {
return false;
}
if (PlayerList[vTarget].isDead) {
return false;
}
if (PlayerList[vTarget].Dormant) {
return false;
}
/*if (!PlayerList[vTarget].Spotted) {
if (cfg[0].misc.visiblecheck == 1) {
return false;
}
}*/
if (PlayerList[vTarget].Health <= 0 || PlayerList[vTarget].Health > 100) {
return false;
}
if (vFov <= /*cfg[Player.wn].aimbot.fov*/ 999) {
return true;
}
return false;
}
int BestTarget() {
int Target = -1;
float mFov = 360;
for (int i = 1; i < 32; i++) {
Vector2 Angles;
CalcAngle(PlayerList[i].abBonePosition, MyPlayer.Position, Angles);
float tFov, hAng, vAng, a_fixAng = Angles.y, p_fixAng = MyPlayer.CurrentViewAngles.y;
vAng = Angles.x - MyPlayer.CurrentViewAngles.x;
if (Angles.y < 0) {
a_fixAng = 360 + Angles.y;
}
if (MyPlayer.CurrentViewAngles.y < 0) {
p_fixAng = 360 + MyPlayer.CurrentViewAngles.y;
}
hAng = min(abs(a_fixAng - p_fixAng), 360 - abs(a_fixAng - p_fixAng));
tFov = sqrt(hAng * hAng + vAng * vAng);
if (tFov < mFov && ValidTarget(i, tFov)) {
mFov = tFov;
Target = i;
}
}
return Target;
}
void aimbot() {
for (;; Sleep(1)) {
if (GetAsyncKeyState(VK_LBUTTON)) {
int Target = BestTarget();
int work = MyPlayer.ShotsFired;
if (Target != -1) {
Vector2 Angles;
Angles.x = MyPlayer.CurrentViewAngles.x;
Angles.y = MyPlayer.CurrentViewAngles.y;
Angles.z = 0;
CalcAngle(PlayerList[Target].abBonePosition, MyPlayer.Position, Angles);
// cout << Angles.x << " " << Angles.y << " " << Angles.z << endl;
SmoothAngles(Angles, 1);
NormalizeAngle(Angles);
if (Angles.y < 180.0f && Angles.y > -180.0f && Angles.x < 90.0f && Angles.x > -90.0f) {
WM<Vector2>(MyPlayer.ClientState + dwViewAngles, Angles);
}
}
}
}
}

if ( CalculatedAngle.NormalizeVector( ) )
{
Vector3 Delta = CalculatedAngle - Engine->GetViewAngle( );
if ( Delta.NormalizeVector( ) )
{
FOV = sqrt( Delta.x * Delta.x + Delta.y * Delta.y );
Vector3 Delta = Engine->GetViewAngle( ) - CalculatedAngle;
if( Delta.NormalizeAngle( ) )
{
CalculatedAngle = Engine->GetViewAngle( ) - Delta / SmoothAmount;
if ( CalculatedAngle.NormalizeAngle( ) )
{
int work = MyPlayer.ShotsFired;

void NormalizeAngle(Vector &angles)
{
if (angles.x > 89.0f && angles.x <= 180.0f) { angles.x = 89.0f; }
if (angles.x > 180.f) { angles.x -= 360.f; }
if (angles.x < -89.0f) { angles.x = -89.0f; }
if (angles.y > 180.f) { angles.y -= 360.f; }
if (angles.y < -180.f) { angles.y += 360.f; }
if (angles.z != 0.0f) { angles.z = 0.0f; }
}
void ClampAngles(Vector &angles)
{
if (angles.x > 89) { angles.x = 89; }
if (angles.x < -89) { angles.x = -89; }
if (angles.y > 180) { angles.y = 180; }
if (angles.y < -180) { angles.y = -180; }
if (angles.z != 0) { angles.z = 0; }
}
void CalcAngle(Vector &src, Vector &dst, Vector &angles, int rcs)
{
int Value;
switch (MyPlayer.Flags) {
case 257: { Value = 64.07; break; }
case 263: { Value = 44.05; break; }
}
double delta[3] = { (src.x - dst.x), (src.y - dst.y), (src.z - dst.z + Value) };
double hyp = sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
angles.x = (float)(asinf(delta[2] / hyp) * 57.295779513082f) - MyPlayer.Punch.x * 2.0f * rcs;
angles.y = (float)(atanf(delta[1] / delta[0]) * 57.295779513082f) - MyPlayer.Punch.y * 2.0f * rcs;
angles.z = 0;
if (delta[0] >= 0.0) { angles.y += 180.0f; }
}
void SmoothAngles(Vector &ang, float smooth) {
ang.x = MyPlayer.CurrentViewAngles.x - (MyPlayer.CurrentViewAngles.x - ang.x) / smooth;
ang.y = MyPlayer.CurrentViewAngles.y - (MyPlayer.CurrentViewAngles.y - ang.y) / smooth;
}
float Get3dDistance(Vector myCoords, Vector enemyCoords)
{
return sqrt(
pow(double(enemyCoords.x - myCoords.x), 2.0) +
pow(double(enemyCoords.y - myCoords.y), 2.0) +
pow(double(enemyCoords.z - myCoords.z), 2.0));
}
bool ValidTarget(int vTarget, int vFov) {
if (vTarget == 0)
return false;
if (vTarget > 32)
return false;
if (PlayerList[vTarget].Team == MyPlayer.Team)
return false;
if (PlayerList[vTarget].isDead)
return false;
// if (PlayerList[vTarget].Dormant)
//* return false;
if (!PlayerList[vTarget].Spotted)
return false;
if (PlayerList[vTarget].Health <= 0 || PlayerList[vTarget].Health > 100)
return false;
if (vFov <= 999999999)
return true;
return false;
}
int BestTarget() {
int Target = -1;
int MaxDist = 1000000;
for (int i = 1; i < 32; i++) {
PlayerList[i].ReadInformation(i);
Vector Angles, Delta;
double distance = Get3dDistance(PlayerList[i].abBonePosition, MyPlayer.Position), FOV;
CalcAngle(PlayerList[i].abBonePosition, MyPlayer.Position, Angles, 1);
Delta.x = Angles.x - MyPlayer.CurrentViewAngles.x;
Delta.y = Angles.y - MyPlayer.CurrentViewAngles.y;
FOV = sqrt(Delta.x * Delta.x + Delta.y * Delta.y);
if (distance < MaxDist && ValidTarget(i, FOV)) {
MaxDist = distance;
Target = i;
// cout << FOV << endl;
}
}
return Target;
}
void aimbot() {
for (;; Sleep(1)) {
if (GetAsyncKeyState(VK_LBUTTON) && RFI.AimBot) {
int Target = BestTarget();
if (Target != -1) {
Vector Angles;
Angles.x = MyPlayer.CurrentViewAngles.x;
Angles.y = MyPlayer.CurrentViewAngles.y;
Angles.z = 0;
CalcAngle(MyPlayer.Position, PlayerList[Target].abBonePosition, Angles, 1);
SmoothAngles(Angles, RFI.AimBotSmooth);
ClampAngles(Angles);
NormalizeAngle(Angles);
if (Angles.y < 180.0f && Angles.y > -180.0f && Angles.x < 90.0f && Angles.x > -90.0f)
WM<Vector>(MyPlayer.ClientState + dwViewAngles, Angles);
Sleep(7);
}
}
}
}
void NormalizeAngle(Vector &angles)
{
if (angles.x > 89.0f && angles.x <= 180.0f) { angles.x = 89.0f; }
if (angles.x > 180.f) { angles.x -= 360.f; }
if (angles.x < -89.0f) { angles.x = -89.0f; }
if (angles.y > 180.f) { angles.y -= 360.f; }
if (angles.y < -180.f) { angles.y += 360.f; }
if (angles.z != 0.0f) { angles.z = 0.0f; }
}
void ClampAngles(Vector &angles)
{
if (angles.x > 89) { angles.x = 89; }
if (angles.x < -89) { angles.x = -89; }
if (angles.y > 180) { angles.y = 180; }
if (angles.y < -180) { angles.y = -180; }
if (angles.z != 0) { angles.z = 0; }
}
/*void Stable(Vector &angles)
{
if (MyPlayer.CurrentViewAngles.y > 0.0f && angles.y > 180.0f) {
Vector calcangles;
calcangles.y = angles.y;
calcangles.y *= -1;
angles.y = -180.0f;
float value = calcangles.y + 180.0f;
value *= -1;
angles.y += value;
}
}*/
void CalcAngle(Vector &src, Vector &dst, Vector &angles, int rcs)
{
int Value;
switch (MyPlayer.Flags) {
case 257: { Value = 64.07; break; }
case 263: { Value = 44.05; break; }
}
double delta[3] = { (src.x - dst.x), (src.y - dst.y), (src.z - dst.z + Value) };
double hyp = sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
angles.x = (float)(asinf(delta[2] / hyp) * 57.295779513082f) - MyPlayer.Punch.x * 2.0f * rcs;
angles.y = (float)(atanf(delta[1] / delta[0]) * 57.295779513082f) - MyPlayer.Punch.y * 2.0f * rcs;
angles.z = 0;
if (delta[0] >= 0.0) { angles.y += 180.0f; }
}
void SmoothAngles(Vector &angles, float smooth) {
angles.x = MyPlayer.CurrentViewAngles.x - (MyPlayer.CurrentViewAngles.x - angles.x) / smooth;
angles.y = MyPlayer.CurrentViewAngles.y - (MyPlayer.CurrentViewAngles.y - angles.y) / smooth;
}
float Get3dDistance(Vector myCoords, Vector enemyCoords)
{
return sqrt(
pow(double(enemyCoords.x - myCoords.x), 2.0) +
pow(double(enemyCoords.y - myCoords.y), 2.0) +
pow(double(enemyCoords.z - myCoords.z), 2.0));
}
bool ValidTarget(int vTarget, int vFov) {
if (vTarget == 0)
return false;
if (vTarget > 32)
return false;
if (PlayerList[vTarget].Team == MyPlayer.Team)
return false;
if (PlayerList[vTarget].isDead)
return false;
// if (PlayerList[vTarget].Dormant)
//* return false;
if (!PlayerList[vTarget].Spotted)
return false;
if (PlayerList[vTarget].Health <= 0 || PlayerList[vTarget].Health > 100)
return false;
if (vFov <= 999999999)
return true;
return false;
}
int BestTarget() {
int Target = -1;
int MaxDist = 1000000;
for (int i = 1; i < 32; i++) {
PlayerList[i].ReadInformation(i);
double distance = Get3dDistance(PlayerList[i].abBonePosition, MyPlayer.Position), FOV;
FOV = sqrt(MyPlayer.CurrentViewAngles.x * MyPlayer.CurrentViewAngles.x + MyPlayer.CurrentViewAngles.y * MyPlayer.CurrentViewAngles.y);
if (distance < MaxDist && ValidTarget(i, FOV)) {
MaxDist = distance;
Target = i;
}
}
return Target;
}
void aimbot() {
for (;; Sleep(1)) {
if (GetAsyncKeyState(VK_LBUTTON) && RFI.AimBot) {
int Target = BestTarget();
if (Target != -1) {
Vector Angles;
Angles.x = MyPlayer.CurrentViewAngles.x;
Angles.y = MyPlayer.CurrentViewAngles.y;
Angles.z = 0;
CalcAngle(MyPlayer.Position, PlayerList[Target].abBonePosition, Angles, 1);
NormalizeAngle(Angles);
SmoothAngles(Angles, RFI.AimBotSmooth);
NormalizeAngle(Angles);
ClampAngles(Angles);
NormalizeAngle(Angles);
if (Angles.y < 180.0 && Angles.y > -180.0 && Angles.x < 90.0 && Angles.x > -90.0)
WM<Vector>(MyPlayer.ClientState + dwViewAngles, Angles);
Sleep(7);
}
}
}
}
FOV = sqrt(MyPlayer.CurrentViewAngles.x * MyPlayer.CurrentViewAngles.x + MyPlayer.CurrentViewAngles.y * MyPlayer.CurrentViewAngles.y);
CalcAngle(MyPlayer.Position, PlayerList[Target].abBonePosition, Angles, 1);
AnglePosition = RM<Vector>(Base + dwVecOrigin + dwVecViewOffset);
CalcAngle(MyPlayer.AnglePosition, PlayerList[Target].abBonePosition, Angles, 1);
void ClampAngles(Vector &angles)
{
if (angles.x > 89) { angles.x = 89; }
if (angles.x < -89) { angles.x = -89; }
if (angles.y > 180) { angles.y = 180; }
if (angles.y < -180) { angles.y = -180; }
angles.z = 0;
}
void NormalizeAngle(Vector &angles)
{
if (angles.y > 180.f) { angles.y -= 360.f; }
if (angles.y < -180.f) { angles.y += 360.f; }
if (angles.z != 0.0f) { angles.z = 0.0f; }
}
Vector CalcAngles, MyAnglesPos; CalcAngles.x = MyPlayer.CurrentViewAngles.x; CalcAngles.y = MyPlayer.CurrentViewAngles.y; CalcAngles.z = 0; NormalizeAngle(CalcAngles); MyAnglesPos.x = MyPlayer.AnglePosition.x + MyPlayer.Position.x; MyAnglesPos.y = MyPlayer.AnglePosition.y + MyPlayer.Position.y; MyAnglesPos.z = MyPlayer.AnglePosition.z + MyPlayer.Position.z; CalcAngle(MyAnglesPos, PlayerList[Target].abBonePosition, CalcAngles, 1);



CalcAngles.x = MyPlayer.CurrentViewAngles.x; CalcAngles.y = MyPlayer.CurrentViewAngles.y; CalcAngles.z = 0; NormalizeAngle(CalcAngles);