Advertisement
BaSs_HaXoR

C++ Aimbot Xbox Source Code

Mar 11th, 2015
1,591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.20 KB | None | 0 0
  1. //Code Created By Hacksorce
  2. //Other Code for getting the Positions of all clients
  3. int getClientState(int client)
  4. {
  5. return 0x830CBF80 + (client * 0x3700);
  6. }
  7. struct PlayerData
  8. {
  9.         int Deaths;
  10.         int Kills;
  11.         float Location[2];
  12.         float Current_Location[2];
  13. };
  14. PlayerData PData[18];
  15. void Monitering()
  16. {
  17.         for(;;)
  18.         {
  19.                 if(Dvar_GetBool("cl_ingame"))
  20.                 {
  21.                         for (int i = 0;i<18;i++)
  22.                         {
  23.                                 PData[i].Current_Location[0] = *(float*)(getClientState(i) +0x1c);
  24.                                 PData[i].Current_Location[1] = *(float*)(getClientState(i) +0x20);
  25.                                 PData[i].Current_Location[2] = *(float*)(getClientState(i) +0x24);
  26.                         }
  27.                 }
  28.         }
  29. }
  30. //Main Aimbot Code
  31.   struct  Distance
  32.           {
  33.                   float x, y,z;
  34.           };
  35.  float PI = 3.14159265;
  36. float CompareDisatnce(Distance D1,Distance D2)
  37. {
  38.         float X = D2.x - D1.x;
  39.         float Y = D2.y - D1.y;
  40.         float Z = D2.z - D1.z;
  41.         float distance = sqrt(pow(X,2) + pow(Y,2)+pow(Z,2));
  42.         return distance;
  43. }
  44. int ClosestClient(int Local_client)
  45. {
  46.         float Closest = 99999999999;
  47.         int Closest_Client = -1;
  48.         Distance Loc;
  49.         Distance Cur;
  50.         Loc.x = PData[Local_client].Current_Location[0];
  51.         Loc.y = PData[Local_client].Current_Location[1];
  52.         Loc.z = PData[Local_client].Current_Location[2];
  53.         for(int i = 0;i<18;i++)
  54.         {
  55.                 if(i == Local_client)
  56.                         continue;
  57.         Cur.x = PData[i].Current_Location[0];
  58.         Cur.y = PData[i].Current_Location[1];
  59.         Cur.z = PData[i].Current_Location[2];
  60.         if(CompareDisatnce(Loc,Cur) < Closest)
  61.         {
  62.                 Closest = CompareDisatnce(Loc,Cur);
  63.                 Closest_Client = i;
  64.         }
  65.         }
  66.         return Closest_Client;
  67. }
  68. void Aimbot(int Local_Client,int Target_Client)
  69. {
  70.         Distance Loc, Cur;
  71.         Loc.x = PData[Local_Client].Current_Location[0];
  72.         Loc.y = PData[Local_Client].Current_Location[1];
  73.         Loc.z = PData[Local_Client].Current_Location[2];
  74.         Cur.x = PData[Target_Client].Current_Location[0];
  75.         Cur.y = PData[Target_Client].Current_Location[1];
  76.         Cur.z = PData[Target_Client].Current_Location[2];
  77.         float AimX = atan2f(PData[Target_Client].Current_Location[2] - PData[Local_Client].Current_Location[2],CompareDisatnce(Loc,Cur)) * 180/PI;
  78.         float AimY = atan2f(PData[Target_Client].Current_Location[0] - PData[Local_Client].Current_Location[0],PData[Target_Client].Current_Location[1] - PData[Local_Client].Current_Location[1]) / PI * 180+180;
  79.         *(float*)(getClientState(Local_Client) + 0x214) = AimX;
  80.         *(float*)(getClientState(Local_Client) + 0x218) = AimY;
  81. }
  82. void StartAimbot()
  83. {
  84.         int Button;
  85.         for(;;)
  86.         {
  87.                 Button = Buttons(getHost());
  88.                 if(Button & 0x80800)
  89.                 {
  90.                         Aimbot(getHost(),ClosestClient(getHost()));
  91.                 }
  92.         }
  93. }
  94. //OP: https://pastebin.com/TG9cvAjh#
  95. //BaSs_HaXoR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement