Advertisement
Guest User

Untitled

a guest
Mar 21st, 2015
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1. void getClosestEntity()
  2. {
  3.     aimbotBestFOV = 360.0f;
  4.     AimbotVictim.ID = -1;
  5.     Vector3 localPlayerEyes;
  6.  
  7.     for (int i = 0; i < 64; i++)
  8.     {
  9.         if (EntityList[i].health > 0 && EntityList[i].team != LocalPlayer.team)
  10.         {
  11.             localPlayerEyes.X = LocalPlayer.vecOrigin[0] + LocalPlayer.vecViewOffset[0];
  12.             localPlayerEyes.Y = LocalPlayer.vecOrigin[1] + LocalPlayer.vecViewOffset[1];
  13.             localPlayerEyes.Z = LocalPlayer.vecOrigin[2] + LocalPlayer.vecViewOffset[2];
  14.  
  15.             float fov = getFOV(LocalPlayer.viewAngle, localPlayerEyes, EntityList[i].headBoneXYZ);
  16.  
  17.             if (fov < aimbotBestFOV)
  18.             {
  19.                 aimbotBestFOV = fov;
  20.                 AimbotVictim.ID = i;
  21.             }
  22.         }
  23.     }
  24.  
  25.     Vector3 targetAngles;
  26.     calcAngle(localPlayerEyes, EntityList[AimbotVictim.ID].headBoneXYZ, targetAngles);
  27.  
  28.     AimbotVictim.pitch = targetAngles.X;
  29.     AimbotVictim.yaw = targetAngles.Y;
  30.  
  31.     cout << "Best fov: " << aimbotBestFOV << endl;
  32.     cout << "Victim ID: " << AimbotVictim.ID << endl;
  33.     cout << "Target pitch: " << AimbotVictim.pitch << endl;
  34.     cout << "Target yaw: " << AimbotVictim.yaw << endl;
  35.     Sleep(300);
  36.     system("cls");
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement