Solved My aimbot problem

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

xHunter

Newbie
Full Member
Jun 12, 2017
22
87
1
Hello, I'm having problems with my aimbot for Counter Strike 1.6, he for some reason is not aiming at the enemy's head, he's aiming at the legs, how can I aim him in the head?

C++:
void Aimbot()
{
	float fNearest = (float)INT_MAX;
	for (int id = 1; id <= 32; id++)
	{	
		if (g_Local.iID == id)
			continue;
 
		if (ValidEntity(id) == 0)
			continue;
 
		if (g_Local.iTeam == g_Player[id].Team)
			continue;
 
		if (g_Player[id].IsDead == 0)
			continue;
 
		if (g_Player[id].Visible == 0)
			continue;
 
		float fFOV = calcFovAngle(g_Local.vEye, g_Player[id].Angles, g_Player[id].Position);
 
        float AimAngles[3];
		MyVectorAngles(g_Player[id].Position - g_Local.vEye, AimAngles);
		
		if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
		{
			if (fFOV < fNearest)
			{
				fNearest = fFOV;
				AimAngles[0] -= 2.0f; // AimAngles[0] = MousePitch, AimAngles[1] = MouseYaw, 2.0f = head position, but changes according to my distance to the entity's distance
			    
                if (AimAngles[0] >= -89 && AimAngles[0] <= 89)
				{
					Write<float>(g_Local.dwMousePitch, AimAngles[0]);
					Write<float>(g_Local.dwMouseYaw, AimAngles[1]);
				}
			}
		}
    }
}
 

Oneshot

Meme Tier VIP
Apr 4, 2015
232
190
13
your code is correct. the problem is that you are aiming at the location of the player. and not the location of the head. you need to find the bonematrix and get the location of the head bone instead of the location of the player.
and if thats to hard for you you could always add 64 to the z of player location.
 

xHunter

Newbie
Full Member
Jun 12, 2017
22
87
1
your code is correct. the problem is that you are aiming at the location of the player. and not the location of the head. you need to find the bonematrix and get the location of the head bone instead of the location of the player.
and if thats to hard for you you could always add 64 to the z of player location.

I did not quite understand the part that you said "add 64 to the z of player location", I did it the way I understood (my English is pessimo), please if possible tell me where I am wrong:

C++:
Vector vPos;
vPos.x = g_Player[id].Position.x;
vPos.y = g_Player[id].Position.y;
vPos.z = g_Player[id].Position.z + 64.0f;

MyVectorAngles(vPos - g_Local.vEye, AimAngles);
Edit:

Thanks for the help the way you said is almost perfect the only problem is that depending on the distance (from near the crossbar is half low and from a distance half high) is somewhat inaccurate

C++:
Vector vPos;
vPos.x = g_Player[id].Position.x;
vPos.y = g_Player[id].Position.y;
vPos.z = g_Player[id].Position.z + 21.0f; // 21.0f = Head, but at great distances it is above the head

MyVectorAngles(vPos - g_Local.vEye, AimAngles);

Any tips on how I can fix this? I thought about taking my distance to the distance of the Entity I do not know if it will work
 
Last edited:

Oneshot

Meme Tier VIP
Apr 4, 2015
232
190
13
the best thing is to get the bonematrix and get the location of the head bone and aim at that. thats what we do in csgo. this that we are doing adding 21.0f is just a quick and bad fix. it would kindof work but only if they dont crouch and if they face you. so what you should do is finding the bone matrix of that entity. there should be a pointer to it somewhere in the entity. im not much help in finding where it is. thats hard and thats something you have to do by yourself of find an offset to it online.
 

xHunter

Newbie
Full Member
Jun 12, 2017
22
87
1
the best thing is to get the bonematrix and get the location of the head bone and aim at that. thats what we do in csgo. this that we are doing adding 21.0f is just a quick and bad fix. it would kindof work but only if they dont crouch and if they face you. so what you should do is finding the bone matrix of that entity. there should be a pointer to it somewhere in the entity. im not much help in finding where it is. thats hard and thats something you have to do by yourself of find an offset to it online.


Thanks for your help, I got the code using the Entity distance to my player and adding a value that I found testing 1 by 1 until I found one that works perfectly, but how I like to learn more even with the code working perfectly I'll try to find the bonematrix, do you have any tips you can give me that might help me find it?

C++:
float fDistance = Get3dDistance(g_Local.vEye, g_Player[id].Position) / 100;

float fFixAimPos = 2.50f;
Vector vPos;
vPos.x = g_Player[id].Position.x - (fDistance - fFixAimPos * 3);
vPos.y = g_Player[id].Position.y - fFixAimPos;
vPos.z = g_Player[id].Position.z + 21.0f;
MyVectorAngles(vPos - g_Local.vEye, AimAngles);
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods