Aimbot

Posts 1–12 of 12 · Page 1 of 1
Aimbot
Hey guys. I am having some trouble with my aimbot i am making. I have the player table so i know where everybody's coordinates are and i have my playerclass and i reversed it so that i have my player coords and i have the yaw and pitch. So i have everything i need to make a simple aimbot. The issue is I don't know how to do the math. If somebody can help me with the math I would greatly appreciate it. Thanks.
Anyone??????
Quote Originally Posted by LEGiiTxCHAOTiiC View Post
Post current code
What are you talking about bro? This question doesn't need code, unless you're gonna leech it. I won't post code, all my question was how could I do the math. I would appreciate it if somebody help me with this. Thanks.
Your yaw is in radian representation.

Code:
#define _USE_MATH_DEFINES

#include <cmath>

double radians_to_degrees(double x) {
  return 180 / M_PI * x;
}
Quote Originally Posted by Fovea View Post
Your yaw is in radian representation.

Code:
#define _USE_MATH_DEFINES

#include <cmath>

double radians_to_degrees(double x) {
  return 180 / M_PI * x;
}
Oh, ok. That makes more sense. Thanks Fovea, and will the calculations for yaw and pitch, as given above in the assualt cube aimbot example, work for any game?

---------- Post added at 11:52 PM ---------- Previous post was at 10:53 PM ----------

Ok, so I tried to recreate the aimbot code for assault cube to apply to my game and I used D3DXVectors instead of the custom class and this is what i have:

Code:
D3DXVECTOR3 vec =  D3DXVECTOR3(players->Pos->x,players->Pos->y,players->Pos->z) - D3DXVECTOR3(Client->clientshell->me->x,Client->clientshell->me->y,Client->clientshell->me->z);
			float angle = sqrtf((vec.x * vec.x) + (vec.y * vec.y) + (vec.z * vec.z));
			Client->clientshell->me->pitch = atan2(players->Pos->z - Client->clientshell->me->z, angle) * 180 /PI;
The angles are within range but are no where near the players. Is there something wrong? I am sure that the coordinates I have are accurate.
OMG! I freekin hate the c++ section now. There's nobody to help. I miss the days when Hell Demon was minion. My questions would be answered within 3 hours minimum.
The angle between two vectors is as follows (all angles are in radian):

theta = arccos((vec1 dot vec2)/(|vect1|*|vect2|))

dot = dot product, google it, |vec| = magnitude of vector, google it.

You can then also get the scalar projection (i.e. length/force) of one vector on to the other by (vect1 dot vec2)/|vec2|

Hope this helps, you should be able to turn this into code pretty easily.
CLose this thread, i solved it no thanks to u guys.
Haha ;[

/Closed on request.
Posts 1–12 of 12 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us