1. ## Aimbot angles

Hey im currently using this function

Code:
```void CMaths::CalcAngles(const vec3_t &source, const vec3_t &dest, vec3_t &ang)
{
double delta[3] = { (source[0] - dest[0]), (source[1] - dest[1]), (source[2] - dest[2]) };
double hyp = sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
ang[0] = (float)(atan(delta[2] / hyp) * RADPI);
ang[1] = (float)(atan(delta[1] / delta[0]) * RADPI);
ang[2] = 0.0f;
if (delta[0] >= 0.0f)
ang[0] += 180.0f;

}```
to calulate the angles between 2 players, but it doesnt give me the right angles, any ideas?

2. What values does this give for you, tried outputting those? Sure you are writing those values to the right location?

3. Originally Posted by c5
What values does this give for you, tried outputting those? Sure you are writing those values to the right location?
I'm not writing yet, just outputting it:

EDIT: the output of the X-angles gives me the distance between me and the enemy..

4. also when i use

Code:
```void CMaths::GetAngleToTarget(vec3_t vTarget, vec3_t source, vec3_t vAngles)
{
vec3_t deltaVec;
deltaVec[0] = vTarget[0] - source[0];
deltaVec[1] = vTarget[1] - source[1];
deltaVec[2] = vTarget[2] - source[2];

VectorAngles(deltaVec, vAngles);

if (vAngles[0] > 180.0f)
vAngles[0] -= 360.0f;
else if (vAngles[0] <-180.0f)
vAngles[0] += 360.0f;

if (vAngles[1] > 180.0f)
vAngles[1] -= 360.0f;
else if (vAngles[1] < -180.0f)
vAngles[1] += 360.0f;
}```
i get vAngles[0] as the distance between me and the enemy :O there must be something wrong with my input...

5. Originally Posted by NTvalk
also when i use

Code:
```void CMaths::GetAngleToTarget(vec3_t vTarget, vec3_t source, vec3_t vAngles)
{
vec3_t deltaVec;
deltaVec[0] = vTarget[0] - source[0];
deltaVec[1] = vTarget[1] - source[1];
deltaVec[2] = vTarget[2] - source[2];

VectorAngles(deltaVec, vAngles);

if (vAngles[0] > 180.0f)
vAngles[0] -= 360.0f;
else if (vAngles[0] <-180.0f)
vAngles[0] += 360.0f;

if (vAngles[1] > 180.0f)
vAngles[1] -= 360.0f;
else if (vAngles[1] < -180.0f)
vAngles[1] += 360.0f;
}```
i get vAngles[0] as the distance between me and the enemy :O there must be something wrong with my input...

6. Code:
```vec3_t, aimAngles;
...
if(enemy...){
esp.fenemydistance = maths.SubVectorDist(esp.validClients[i], esp.myInfo) / 47;        // this gives the distance well
maths.GetAngleToTarget (esp.myInfo.vpos,esp.validClients[i].vpos, aimAngles);         // this gives me the wrong x angle
printf("aim x : %f\n", aimAngles[0]);
}```
and this is my vpos
Code:
```        myInfo.posx = *(float*)(0x797618);
myInfo.posy = *(float*)(0x79761C);
myInfo.posz = *(float*)(0x797620);

...

myInfo.vpos[0] = myInfo.posx;
myInfo.vpos[1] = myInfo.posy;
myInfo.vpos[2] = myInfo.posz;```

7. Originally Posted by NTvalk
Code:
```esp.fenemydistance = maths.SubVectorDist(esp.validClients[i], esp.myInfo) / 47;        // this gives the distance well
maths.GetAngleToTarget (esp.myInfo.vpos,esp.validClients[i].vpos, aimAngles);         // this gives me the wrong x angle```
I have no idea what you are doing.

8. Originally Posted by c5
I have no idea what you are doing.
Code:
` esp.validClients[i].vpos`
is a vec3_t of the coordinates of the enemy
and

Code:
` esp.myInfo.vpos`
are my coordinates

9. Originally Posted by NTvalk
Code:
` esp.validClients[i].vpos`
is a vec3_t of the coordinates of the enemy
and

Code:
` esp.myInfo.vpos`
are my coordinates
Obviously, got that part, but this:

Code:
```esp.fenemydistance = maths.SubVectorDist(esp.validClients[i], esp.myInfo) / 47;        // this gives the distance well
maths.GetAngleToTarget (esp.myInfo.vpos,esp.validClients[i].vpos, aimAngles);         // this gives me the wrong x angle```

10. Originally Posted by c5
Obviously, got that part, but this:

Ohh i see sorry, you mean this function?
Code:
```void CMaths::VectorAngles(const vec3_t value1, vec3_t angles) {
float flTmp, flYaw, flPitch;
if (value1[2] == 0 && value1[0] == 0)
{
flYaw = 0;
flPitch = 270;
}
else
{
flYaw = (atan2(value1[2], -value1[0]) * 180.f / 3.14159265358979323846) - 180.f;
if (flYaw < 0)
{
flYaw += 360.f;
}

flTmp = sqrt(value1[0] * value1[0] + value1[2] * value1[2]);
flPitch = (atan2(value1[1], flTmp) * 180.f / 3.14159265358979323846);

if (flPitch < 0)
{
flPitch += 360.f;
}
}
angles[0] = flPitch;
angles[1] = flYaw;
angles[2] = 0;
}```

Page 1 of 3 123 Last