Aimbot aiming only once
Hello guys, meine aimbote is fucked up a little, and i don't know what is going on. Fov function is correct. Some1 maybe know where is error ? Aimbot code below .
Code:
while (true)
{
if (bEnable)
{
D3DXVECTOR3 AimAngle;
int Target = -1;
for (int i = 0; i < 64; i++)
{
tEntityList pEntity = pEntityList[i];
if (!pEntity.BaseAddr)
continue;
if (pEntity.Dormant)
continue;
if (pEntity.Health < 1)
continue;
auto FOV = GetFov(pLocalPlayer.ViewAngle, pLocalPlayer.EyePostion, BonePos(pEntity.BoneMatrixAddress, aim_bone));
if (FOV <= aim_fov)
{
aim_fov = FOV;
Target = i;
}
Sleep(1);
}
if (GetAsyncKeyState(aim_key) & 0x8000 && Target != -1)
{
if (pLocalPlayer.Team!=pEntityList[Target].Team && !pEntityList[Target].Dormant && pEntityList[Target].Health > 1)
{
AimAngle = CalcAngle(pLocalPlayer.EyePostion, BonePos(pEntityList[Target].BoneMatrixBaseAddress, aim_bone));
Normalize(AimAngle);
AimAngle.x -= pLocalPlayer.PunchAngle.x *2.f;
AimAngle.y -= pLocalPlayer.PunchAngle.y *2.f;
AimAngle.z = 0.f;
Normalize(AimAngle);
pMemory.Write<D3DXVECTOR3>(pLocalPlayer.ClientState + Offsets.m_dwViewAngle, AimAngle);
}
}
}
Sleep(1);
}