 Cheat EngineThe Official Site of Cheat Engine

Author Message
Kewun
Cheater Reputation: 0

Joined: 18 Sep 2016
Posts: 42 Posted: Tue Feb 13, 2018 5:34 am    Post subject: Aimbot Failure I am creating a aimbot for GTA: Vice City

The problem I have is in the Video

When I stand in other position of the enemy, It aims somewhere else

 Code: CPed * target = FindPlayerPed()->m_apNearPeds;                      auto distanceXZ = sqrtf(powf(target->GetPosition().x - FindPlayerPed()->GetPosition().x, 2) + powf(target->GetPosition().z - FindPlayerPed()->GetPosition().z, 2));                      auto f_z = atan2f((target->GetPosition().y) - FindPlayerPed()->GetPosition().y, distanceXZ);                      auto f_x = atan2f((target->GetPosition().z) - FindPlayerPed()->GetPosition().z, distanceXZ);                      f_z = -f_z;                      f_x = -f_x;                      patch::SetFloat(0x7E48BC, f_x - 0.19, true);//left-right                      patch::SetFloat(0x7E48CC, f_z, true); //up-down

This is the code i use, any Idea what is wrong? Maybe incorrect maths? someone can help me? [/code]   elmarcia
How do I cheat? Reputation: 0

Joined: 13 Feb 2018
Posts: 2 Posted: Tue Feb 13, 2018 8:06 am    Post subject: Don't know how axis are defined in GTA but i'll assume Y is where gravity is applied for this example.

(x,y,z)
Lets say you are at pos (1,1,1), and your enemy is at (3,1,4).
If you want to look at your target you need to find the angle between those two points. Note that in this example you are at the same height as your enemy, so we will only cover rotation on plane XZ.
So following my perfect drawing in paint we got.
dx = 2 (TargetX - playerX)
dz = 3 (TargetZ - playerZ)

the angle between those two is atan(dz/dx) but this will only work with the first quadrant, that means we will have to apply transformations to get the correct angle in every quadrant, luckily for us we got atan2(y,x) that does all the work for us.

So our aim angle in xz or rotation around xz will be
atan2(dz,dx), this function will return an angle in radians, make sure to convert to degrees if the rotation is in degrees in your game.

This should fix your rotation around plane XZ.

Can't post urls , but i will attach my drawing

axis.png
Description:
Filesize:  11.83 KB
Viewed:  9972 Time(s)    Kewun
Cheater Reputation: 0

Joined: 18 Sep 2016
Posts: 42 Posted: Tue Feb 13, 2018 8:41 am    Post subject: Did not really understand.. Maybe I am noob in trigonometry You said that dx = 2 (TargetX - playerX) dz = 3 (TargetZ - playerZ) But what are those 2 and 3 ? multiplies ?   elmarcia
How do I cheat? Reputation: 0

Joined: 13 Feb 2018
Posts: 2 Posted: Wed Feb 14, 2018 6:20 am    Post subject: No, is the difference between your enemy position and yours. Supose your enemy is at (3,1,4) anda you at (1,1,1) The difference between those points result in (3,1,4) - (1,1,5) Then dx = 3 - 1 , dy = 1 - 1, dz = 4 - 5 Resulting dx = 2, dy = 0, dz = -1 Those are random values for this example. dz = target->GetPosition().z - FindPlayerPed()->GetPosition().z dz = same for x   Kewun
Cheater Reputation: 0

Joined: 18 Sep 2016
Posts: 42 Posted: Mon Feb 26, 2018 9:09 am    Post subject: I have fixed some of the code, X rotation works good now, but i have problem with the up/down side, I can never get it to work.

 Code: void CAimbotProcess() {    CPed * nearest = NULL;    CPed * nearet = NULL;    for (int i = 0; i < CPools::ms_pPedPool->m_nSize; i++)    {       nearest = CPools::ms_pPedPool->GetAt(i);       if (nearest)       {          if (nearest != FindPlayerPed())          {             if (GetDistance(FindPlayerPed()->GetPosition(), nearest->GetPosition()) < 80 && !nearest->m_bInVehicle && nearest->IsVisible() && nearest->m_dwAction != 0x36 && nearest->m_dwAction != 0x37)             {                nearet = nearest;             }          }       }    }    if (nearet && KeyPressed(VK_LBUTTON))    {       float eIn = nearet->m_vecMoveSpeed.Magnitude();       if (nearet->m_dwAction != 0x37 && nearet->m_dwAction != 0x36 && nearet->IsVisible())       {                    float DWADistance = sqrt(pow(nearet->GetPosition().x - FindPlayerPed()->GetPosition().x, 2) + pow(nearet->GetPosition().y - FindPlayerPed()->GetPosition().y, 2));          CVector Difference = FindPlayerPed()->GetPosition() - nearet->GetPosition();          if (Difference.Magnitude() <= 10.0)          {             aimbot_pos = 0.05;          }          if (Difference.Magnitude() >= 10.0 && Difference.Magnitude() < 29.11)          {             aimbot_pos = 0.05;          }          if (Difference.Magnitude() >= 29.11 && Difference.Magnitude() < 50.00)          {             aimbot_pos = 0.050;          }          if (Difference.Magnitude() >= 50.00)          {             aimbot_pos = 0.048;          }          if (nearet->GetPosition().z + 0.2 > FindPlayerPed()->GetPosition().z)          {             float deltaZ = nearet->GetPosition().z + 0.2 - (FindPlayerPed()->GetPosition().z);             float AngleY = atan2(deltaZ, DWADistance) * 180 / PI;             float AngleYPercentage = AngleY / 360;             float ToWriteAngleY = (CompleteCircleAngle*AngleYPercentage);             //   patch::SetFloat(0x7E48BC, ToWriteAngleY, true); problem          }          else          {             float deltaZ = (FindPlayerPed()->GetPosition().z) - nearet->GetPosition().z;             float AngleY = atan2(deltaZ, DWADistance) * 180 / PI;             float AngleYPercentage = AngleY / 360;             float ToWriteAngleY = (CompleteCircleAngle*AngleYPercentage);             //   patch::SetFloat(0x7E48BC, ToWriteAngleY, true); problem          }          if (nearet->GetPosition().x > FindPlayerPed()->GetPosition().x)          {             if (nearet->GetPosition().x > FindPlayerPed()->GetPosition().x && nearet->GetPosition().y > FindPlayerPed()->GetPosition().y)             {                float deltaX = nearet->GetPosition().x - FindPlayerPed()->GetPosition().x;                float deltaY = nearet->GetPosition().y - FindPlayerPed()->GetPosition().y;                float AngleX = atan2(deltaY, deltaX) * 180 / 3.14159265358979323846;                float AngleXPercentage = AngleX / 360;                float ToWriteAngleX = 3.14159265358979323846 + (PI * 2 * AngleXPercentage);                patch::SetFloat(0x7E48CC, ToWriteAngleX + aimbot_pos, true);             }             else if (nearet->GetPosition().x < FindPlayerPed()->GetPosition().x && nearet->GetPosition().y > FindPlayerPed()->GetPosition().y)             {                float deltaX = nearet->GetPosition().x - FindPlayerPed()->GetPosition().x;                float deltaY = nearet->GetPosition().y - FindPlayerPed()->GetPosition().y;                float AngleX = atan2(deltaY, deltaX) * 180 / 3.14159265358979323846;                float AngleXPercentage = AngleX / 360;                float ToWriteAngleX = 3.14159265358979323846 * 2 - (PI * 2 * AngleXPercentage);                patch::SetFloat(0x7E48CC, ToWriteAngleX + aimbot_pos, true);             }             else if (nearet->GetPosition().x < FindPlayerPed()->GetPosition().x && nearet->GetPosition().y < FindPlayerPed()->GetPosition().y)             {                float deltaX = nearet->GetPosition().x - FindPlayerPed()->GetPosition().x;                float deltaY = nearet->GetPosition().y - FindPlayerPed()->GetPosition().y;                float AngleX = atan2(deltaY, deltaX) * 180 / 3.14159265358979323846;                float AngleXPercentage = AngleX / 360;                float ToWriteAngleX = 3.14159265358979323846 * 2 + (PI * 2 * AngleXPercentage);                patch::SetFloat(0x7E48CC, ToWriteAngleX + aimbot_pos, true);             }             else if (nearet->GetPosition().x > FindPlayerPed()->GetPosition().x && nearet->GetPosition().y < FindPlayerPed()->GetPosition().y)             {                float deltaX = nearet->GetPosition().x - FindPlayerPed()->GetPosition().x;                float deltaY = nearet->GetPosition().y - FindPlayerPed()->GetPosition().y;                float AngleX = atan2(deltaY, deltaX) * 180 / 3.14159265358979323846;                float AngleXPercentage = AngleX / 360;                float ToWriteAngleX = 3.14159265358979323846 + (PI * 2 * AngleXPercentage);                patch::SetFloat(0x7E48CC, ToWriteAngleX + aimbot_pos, true);             }          }          else if (nearet->GetPosition().x < FindPlayerPed()->GetPosition().x)          {             auto distanceXZ = sqrtf(powf(nearet->GetPosition().x - FindPlayerPed()->GetPosition().x, 2) + powf(nearet->GetPosition().z - FindPlayerPed()->GetPosition().z, 2));             auto f_z = atan2f((nearet->GetPosition().y) - FindPlayerPed()->GetPosition().y, distanceXZ);             auto f_x = atan2f((nearet->GetPosition().z) - FindPlayerPed()->GetPosition().z, distanceXZ);             f_z = -f_z;             f_x = -f_x;             patch::SetFloat(0x7E48CC, f_z + aimbot_pos, true);          }       }    } }

I still need help with the Y position [/code]   Kewun
Cheater Reputation: 0

Joined: 18 Sep 2016
Posts: 42 Posted: Sun Mar 11, 2018 6:54 am    Post subject: bump   Filipe_Br
Master Cheater Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house Posted: Thu Apr 19, 2018 9:02 am    Post subject: Re: Aimbot Failure A pseudo code that I use in my aimbots and works well. Taking into account that Y is the upward direction (gravity). sub.x = enemy.x - player.x sub.y = enemy.x - player.y sub.z = enemy.x - player.z lenxz = sqrt( sub.x*sub.x + sub.z*sub.z ) targetAngle.pitch= ToDegrees(atan2( sub.z, sub.x )) targetAngle.yaw = ToDegrees(atan2( sub.y, lenxz )) _________________...   Kewun
Cheater Reputation: 0

Joined: 18 Sep 2016
Posts: 42 Posted: Mon Jul 23, 2018 4:43 am    Post subject: this code you provided isnt compatible with this :/ I still need help, bump   Kewun
Cheater Reputation: 0

Joined: 18 Sep 2016
Posts: 42 Posted: Sat Apr 20, 2019 4:38 am    Post subject: bump :/ can someone help me?   &#7936;&#947;&
Newbie cheater Reputation: 22

Joined: 09 Feb 2013
Posts: 13
Location: Location Location Location Posted: Sun May 26, 2019 9:58 pm    Post subject: This method has been in use since the days of CS

Perhaps you aren't subtracting properly

_________________
Imagine if dark byte converted to Islam after all this

 t328163 wrote: lmfao, on reddit i'd get banned    atom0s
Moderator Reputation: 157

Joined: 25 Jan 2006
Posts: 8139
Location: 127.0.0.1 Posted: Mon May 27, 2019 2:32 am    Post subject: There are tons of aimbot examples across the web, on sites such as UnknownCheats and similar. There's not many things people can do to assist more than what they have here. The game you're targeting is already widely hacked openly as well, with various resources for the exact info you are asking about. _________________- Retired.    Kewun
Cheater Reputation: 0

Joined: 18 Sep 2016
Posts: 42 Posted: Sat Jun 01, 2019 4:17 am    Post subject: Yeah, but the game is 3D, and crosshair position isn't on the center of screen. Its like 4-5 points to the right side of screen Screenshot below. And yeah, I have been looking for web examples, but most of them do not have the calculation of Y screen position, just X.[/img]   Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 6 Hours Page 1 of 1

 Jump to: Select a forum Cheat Engine----------------Cheat EngineCheat Engine MacOSCheat Engine Lua ScriptingCheat Engine ExtensionsCheat Engine TutorialsGeneral GamehackingAuto Assembler tutorialsPointer tutorialsGame specific tutorialsWebbrowser stuff related tutorialsConsole ModdingLUA Tutorials General Discussions----------------General DiscussionsArtComputer TalkRandom spamArt RequestsArt TutorialsWillekeurige RotzooiGuestsHorse Excrement Cheat Requests----------------Single player cheat request Cheat Engine Downloads----------------TablesTrainersAuto Assemble scripts Coding----------------Cheat Engine SourceCETC Server and ClientsDBVMPlugin developmentGeneral programmingBinariesCrackmesGeneral programming+Game Development2D Graphics3D ModelingGameplay designWeb Development Games----------------Flash GamesGaia OnlineStick Arena Hello Kitty Forums----------------Temp
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum