Help with Aimbot
Hello MPGH, Im starting the aimbot for my multihack and i was looking at Nether's Source to see how aimbots work and i couldn't get it working for some reason, ive moved it into my multihack (im intending to re-write it when its fixed) and i would appreciate some help
Here is what i have for the aimbot
And Here is what i have for the structs
Any help would be greatly appreciated and if you help, you will be credited when i post the next version
Here is what i have for the aimbot
Code:
float Get3D1(float X, float Y, float Z, float eX, float eY, float eZ)
{
return(sqrtf((eX - X) * (eX - X) + (eY - Y) * (eY - Y) + (eZ - Z) * (eZ - Z)));
}
float CloseEnt()
{
//Variables
float fLowest = 100000, TMP;
int iIndex;
for (int i = 0; i < 32; i++)
{
EnemyPlayer[i].ReadInfo(i);
//Store Distances In Array
TMP = Get3D1(EnemyPlayer[0].Posi[0], EnemyPlayer[0].Posi[1], EnemyPlayer[0].Posi[2], EnemyPlayer[i].Posi[0], EnemyPlayer[i].Posi[1], EnemyPlayer[i].Posi[2]);
//If Enemy Has Lower Distance The Player 1, Replace (var)Lowest With Current Enemy Distance
if (TMP < fLowest && EnemyPlayer[i].Health != 0)
{
fLowest = TMP;
iIndex = i;
}
}
return iIndex;
}
void CalcAngle(float *src, float *dst, float *angles, int fFlags)
{
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;
}
if (fFlags == 775)
angles[0] = angles[0] + 5;
}
void Aimbot() {
if (GetAsyncKeyState(VK_MBUTTON))
{
for (int i = 0; i < 32; i++)
{
EnemyPlayer[i].ReadInfo(i);
//Get Closest Entity Array Index Number
int Index = CloseEnt();
//Calculate Angle To Closest Entity
CalcAngle(EnemyPlayer[0].Posi, EnemyPlayer[i].Posi, EnemyPlayer[i].Angle, EnemyPlayer[i].Flags);
//Write To AngRotation The Current Angle Of The Entity
Mem.Write<float>(dwAngPtr + 0x4C88, EnemyPlayer[i].Angle[0]);
Mem.Write<float>(dwAngPtr + 0x4C8C, EnemyPlayer[i].Angle[1]);
//I did call the games function SetAng Here but it has bugs, Will be fixed on next release
//Ill also add Bone-Aimbot ( i just cba to add it all in with the bulk pointers :P
}
}
}
Code:
struct EnemyPlayer_t
{
uintptr_t CEntityList;
int Health;
int TeamNum;
int Dormant;
int ArmorValueInt;
int Flags;
float Posi[3];
float Angle[3];
void ReadInfo(int _pInfo) {
CEntityList = Mem.Read<uintptr_t>(Client + EntityList + (_pInfo * 0x10));
Health = Mem.Read<int>(CEntityList + iHealth);
TeamNum = Mem.Read<int>(CEntityList + iTeamNum);
ArmorValue = Mem.Read<int>(CEntityList + ArmorValue);
Dormant = Mem.Read<int>(CEntityList + IsDormant);
Flags = Mem.Read<int>(CEntityList + m_fFlags);
Posi[0] = Mem.Read<float>(CEntityList + vecOrigin);
Posi[1] = Mem.Read<float>(CEntityList + vecOrigin + 0x4);
Posi[2] = Mem.Read<float>(CEntityList + vecOrigin + 0x8);
Angle[0] = Mem.Read<float>(Client + ViewAngle);
Angle[1] = Mem.Read<float>(Client + ViewAngle + 0x4);
Angle[2] = Mem.Read<float>(Client + ViewAngle + 0x8);
}
}EnemyPlayer[32];


