After the failiure with the traceray triggerbot because of it being to advanced I decided to develop a view angle trigger.
The problem I am having is comparing the view angles. If I make it a aimbot by setting the calc angle it directly goes to the head but when I compare them with a if statement it does not shoot when I aim for the headbone. Keep in mind this is not hitbox, only going after the headbone.
Code:
int main()
{
DWORD pId;
HWND hwnd = FindWindow(NULL, "Counter-Strike: Global Offensive");
GetWindowThreadProcessId(hwnd, &pId);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, NULL, pId);
DWORD clientDll = getDll(pId, "client.dll");
DWORD engineDll = getDll(pId, "engine.dll");
while (true)
{
Vector localPosition = Player.getPosition(hProc, clientDll);
Vector viewAngle = Player.getViewAngle(hProc, engineDll);
for (int i = 0; i < 64; ++i)
{
Vector headBone = Entity.getHeadPos(hProc, clientDll, i);
Vector vAngle = CalcAngle(localPosition, headBone);
if (viewAngle.x == vAngle.x && GetAsyncKeyState(0x02)) // I dont care about the elevation.
{
click(); //If I replace this with Player.setViewAngle(hProc, clientDll, vAngle); it works like a charm.
}
}
Sleep(1); system("cls");
}
return 0;
}
I hope you understand that you have to hit the exact position of the head, which is very unlikely to happen.
Originally Posted by WasserEsser
I hope you understand that you have to hit the exact position of the head, which is very unlikely to happen.
soz forgot to change the if statement to:
Code:
if (viewAngle.y == vAngle.y && GetAsyncKeyState(0x02))
Only have to line it up with yaw for it to shoot?
Originally Posted by samlarenskoog
soz forgot to change the if statement to:
Code:
if (viewAngle.y == vAngle.y && GetAsyncKeyState(0x02))
That doesn't change the fact that you still have to hit that exact spot, it doesn't matter if it's x or y.
Originally Posted by WasserEsser
That doesn't change the fact that you still have to hit that exact spot, it doesn't matter if it's x or y.
is there a way to make it shoot only when the crosshair is inline with the yaw axis of the headbone?
Originally Posted by samlarenskoog
is there a way to make it shoot only when the crosshair is inline with the yaw axis of the headbone?
You most likely mean pitch ( x ), yaw would make no sense as it's horizontal, but that's what you already do. It's just that you have to hit exactly that line in order to shoot.
just use an fov function same as you would a normal aimbot but just keep the range low how early/late you want it to trigger.
Originally Posted by WasserEsser
You most likely mean pitch ( x ), yaw would make no sense as it's horizontal, but that's what you already do. It's just that you have to hit exactly that line in order to shoot.
shouldnt it be enough for the trigger to work? If I move across this line while holding the trigger key, shouldnt it shoot automatically?
Originally Posted by samlarenskoog
shouldnt it be enough for the trigger to work? If I move across this line while holding the trigger key, shouldnt it shoot automatically?
The problem is that this line is so tiny that moving left to right can skip this line. Imagine the line being at y 25. Now you move your mouse from 24.85 to 25.21, you missed this one point there because of a high sens or whatever. Try setting your sensitivity to a really really low amount and move your mouse from the left to the right.
Even the slightest change will result in not shooting.
You could even say that the line is at 25.0161753, and when you move your mouse the lowest amount you could possibly move your mouse, due to the sensitivity your mouse would move from 25.0161752 to 25.0161754, you wouldn't hit the line.
Originally Posted by WasserEsser
The problem is that this line is so tiny that moving left to right can skip this line. Imagine the line being at y 25. Now you move your mouse from 24.85 to 25.21, you missed this one point there because of a high sens or whatever. Try setting your sensitivity to a really really low amount and move your mouse from the left to the right.
Even the slightest change will result in not shooting.
You could even say that the line is at 25.0161753, and when you move your mouse the lowest amount you could possibly move your mouse, due to the sensitivity your mouse would move from 25.0161752 to 25.0161754, you wouldn't hit the line.
Would something like this work?
If ((vAngle.x - 3) < viewAngle.x < (vAngle.x + 3))
Originally Posted by samlarenskoog
Would something like this work?
If ((vAngle.x - 3) < viewAngle.x < (vAngle.x + 3))
I got it working but, there is a 90 degree angle where it does not shoot. I have the same problem with my aimbot. Do you have any idea why this is occuring? I use the same calcangle on both, might be it? If you want, I can send you a video on it aswell.
Originally Posted by samlarenskoog
I got it working but, there is a 90 degree angle where it does not shoot. I have the same problem with my aimbot. Do you have any idea why this is occuring? I use the same calcangle on both, might be it? If you want, I can send you a video on it aswell.
You have to normalize every vector you do any operation on. If you're dividing vectors, normalize them right after, if you get the delta of anything, normalize it right after, if you multiply a vector, normalize it right after. Angles work differently in each quadrant.
Originally Posted by WasserEsser
You have to normalize every vector you do any operation on. If you're dividing vectors, normalize them right after, if you get the delta of anything, normalize it right after, if you multiply a vector, normalize it right after. Angles work differently in each quadrant.
does it matter if I clamp the angle at the same time? My normalize function also clamps.
Originally Posted by samlarenskoog
does it matter if I clamp the angle at the same time? My normalize function also clamps.
Yes, this could result in further calculations being wrong since you are not using the value you're supposed to use.