Project Eula How do I cheat?
Reputation: 0
Joined: 16 Jan 2019 Posts: 7
|
Posted: Tue Oct 20, 2020 2:36 pm Post subject: problem with player angle |
|
|
Good afternoon everyone, please someone so kind explain to me why the following problem occurs, I am creating a trainer and the problem is that when the chicken moves the angle is distorted a minimum of 1 to 2 degrees, so it is impossible target the chicken why does this problem occur? Is the formula for calculating the distance not correct? I leave you my formula to calculate angle and distance. Someone so kind to explain.
The player's Z sight position has a minimum of (float -60) and a maximum of (float 60)
The position of the player's X sight has a rotation of 360º minimum 0 maximum 360º
floating values
j_x =readFloat(x.player);-- jugador X
j_y =readFloat('y.player');-- jugador Y
j_z =readFloat('z.player');-- jugador Z
---------------------------
e_x =readFloat('x.chiken');-- enemigo X
e_y =readFloat(y.chiken);-- enemigo Y
e_z =readFloat(z.chiken');-- enemigo Z
sus_X = ((j_x)-(e_x))-- Calculate the distance X between the player and the chicken
sus_Y = ((j_y)-(e_y))--Calculate the distance Y between the player and the chicken
angle = -math.atan2 ( -sus_X,-sus_Y)* (180 / 3.14159265359)
print(angle)--- calculate angle X
=====================================
============= calculate player Z angle
Raiz_Z =math.sqrt(((j_x - e_x) * (j_x - e_x)) + ((j_y - e_y) * (j_y - e_y)) + ((j_z - e_z) * (j_z - e_z)))
angulo_Z =-math.atan2( (j_z)-(e_z),Raiz_Z)* (180/ 3.14159265359)
print(angulo_Z )--get the Z angle of the player
|
|