/*
SA:MP Aimbot
Hold down fire & aim key
*/
if (cAimbot)
{
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)0xB6F5F0, &gpoint, 4, 0);
if ((gpoint > 0) && (t == 0))
{
t = 1;
}
if (gpoint > 0)
{
pmtrx1 = gpoint + 0x14;
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)pmtrx1, &pmtrx1, 4, 0);
xpos1 = pmtrx1 + 0x30;
ypos1 = pmtrx1 + 0x34;
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)xpos1, &fxpos1, 4, 0);
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)ypos1, &fypos1, 4, 0);
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)0xB6F9CC, &fcxpos, 4, 0);
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)0xB6F9D0, &fcypos, 4, 0);
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)0xB6F3B8, &ptarget, 4, 0);
pped = ptarget + 0x79C;
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)pped, &pped, 4, 0);
if (pped > 0)
{
pvectorx = pped + 0x44;
pvectory = pped + 0x48;
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)pvectorx, &fpvectorx, 4, 0);
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)pvectory, &fpvectory, 4, 0);
pmtrx2 = pped + 0x14;
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)pmtrx2, &pmtrx2, 4, 0);
xpos2 = pmtrx2 + 0x30;
ypos2 = pmtrx2 + 0x34;
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)xpos2, &fxpos2, 4, 0);
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)ypos2, &fypos2, 4, 0);
php = pped + 0x540;
ReadProcessMemory(GetCurrentProcess(), (LPCVOID)php, &fphp, 4, 0);
if (fphp > 0)
{
fxpos2a = fxpos2;
fypos2a = fypos2;
aa = fabs(fcxpos-fxpos2);
ab = fabs(fcypos-fypos2);
ac = sqrt(aa*aa+ab*ab);
alpha = asin(aa/ac);
beta = acos(aa/ac);
if ((fxpos1 > fxpos2)&&(fypos1 < fypos2))
{
beta = -beta;
}
if ((fxpos1 > fxpos2)&&(fypos1 > fypos2))
{
beta = beta;
}
if ((fxpos1 < fxpos2)&&(fypos1 > fypos2))
{
beta = (alpha + (3.14/2));
}
if ((fxpos1 < fxpos2)&&(fypos1 < fypos2))
{
beta = (-alpha - (3.14/2));
}
camxpos = beta+0.0389;
// Rotate camera
WriteProcessMemory(GetCurrentProcess(), (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL);
}
}
}
}