Aimbot aiming only once

Posts 1–4 of 4 · Page 1 of 1
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);
	}
That's a pretty easy to fix problem, which you could've fixed by debugging your code.

Your aimbot isn't aiming once, it's aiming twice. Lets say the enemy is 20 "FOV units" away from your crosshair. You'll iterate through every player and end up aiming at this player, since he is the closest one. You set aim_fov to 20 when you got to the player aswell as Target to i. After you've iterated through every player, you set your angle. Now, let's do it again. aim_fov is currently 20, once you iterated through every player, you'll aim at the player you've just aimed last tick, since he is now 0 - 1 "FOV units" away ( we just aimed at him ). aim_fov is getting set to 0 - 1, you aim at him again. Next tick, now wait. The enemy or my own player moved, the target is not 0 - 1 "FOV units" away anymore. But aim_fov is still 0 - 1, we can't get any closer target anymore unless we have our crosshair exactely at the enemy.

TL;DR: You don't reset your aim_fov variable after the for loop. After the for loop, set it to the old aim_fov value again, the value of the menu or whatever.

P.S.: I want to encourage you to use the Visual Studio debugger. It's there for a reason. You had to wait 9 hours for me to post an answer, which could be even longer, depending on when you read this post. If you would've used the debugger and stepped through your code, you would've noticed the exact same behaviour, and wouldn't have to wait 9 hours to some noob like me to post this answer.
Yea, thanks, i was my mistake, all is working now correrctly.
/Solved & closed.
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us