My Aimbot is not aiming.
Hello,
So here is the deal:
This is what I got:
Here is the calc function:
Just copy/paste from fleep.
And the problem is, that it is not aiming. Please help.
So here is the deal:
This is what I got:
Code:
float myAngles[3];
//I get my and enemy position (enemy is in crosshair)
CalcAngle(myPos, EnPos, myAngles);
std::cout << "myAngles: " << myAngles[0] << ", " << myAngles[1] << ", " << myAngles[2] << endl; //Ignore this just my debug
DWORD dwAngles = Mem.Read<DWORD>(dwEngine + 0x0067BA24);
Mem.Write<float>(dwAngles + 0x4CE0, myAngles[0]);
Mem.Write<float>(dwAngles + (0x4CE0 + 0x4), myAngles[1])
;
Here is the calc function:
Just copy/paste from fleep.
Code:
void CalcAngle(float *src, float *dst, float *angles)
{
double delta[3] = { (src[0] - dst[0]), (src[1] - dst[1]), (src[2] - dst[2]) };
double hyp = sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
angles[0] = (float)(asinf(delta[2] / hyp) * 57.295779513082f);
angles[1] = (float)(atanf(delta[1] / delta[0]) * 57.295779513082f);
angles[2] = 0.0f;
if (delta[0] >= 0.0)
{
angles[1] += 180.0f;
}
}
And the problem is, that it is not aiming. Please help.
?
