void Aimbot() { if (!aimbottoggle) { return; } int forceAttack = bClient + Offsets.oAttack; if (GetAsyncKeyState(lookforKey) < 0 || !holdMouse1) { int playerIndex = vam.ReadInt32((IntPtr)(vam.ReadInt32((IntPtr)(bClient + Offsets.oLocalPlayer)) + 0x64)) - 1; float smallestDistance = float.MaxValue; int indexOfSmallestDistance = -1; var localPlayer2 = GetBonePosition(2, playerIndex, bClient, vam); Vector3 localPlayer = getLocalPlayerPosition(vam, bClient); #region Closest to Crosshair for (int j = 0; j < 65; j++) { if (j == playerIndex) { continue; } if (isAlive(j, vam, bClient)) { if (!isEntityByIdOnMyTeam(playerIndex, j, vam, bClient)) { Point aimAt = new Point(); bool g = WorldToScreen(getPlayerVectorByIndex(vam, bClient, j), ref aimAt, vam, getMatrixFloats2(csgo, bClient), t); if (aimAt.x != 200) { float currentDistance = float.MaxValue; float WidthDiv2 = (t.Right - t.Left) / 2; float HeightDiv2 = (t.Bottom - t.Top) / 2; currentDistance = (float)Math.Sqrt(Math.Pow(Math.Abs(WidthDiv2 - aimAt.x), 2) + (float)Math.Pow(Math.Abs(aimAt.y - HeightDiv2), 2)); //currentDistance = (float)Math.Sqrt(currentDistance); if (currentDistance < smallestDistance) { localPlayer2 = GetBonePosition(37, playerIndex, bClient, vam); localPlayer = getLocalPlayerPosition(vam, bClient); if (map.IsVisible(localPlayer2, GetBonePosition(boneIndex, j, bClient, vam)) || map.IsVisible(localPlayer, GetBonePosition(boneIndex, j, bClient, vam)) || !spottedNeedsToBeTrue) { smallestDistance = currentDistance; indexOfSmallestDistance = j; } } } } } } //int entity2 = vam.ReadInt32((IntPtr)(bClient + Offsets.oEntityList + (indexOfSmallestDistance) * Offsets.oEntityLoopDistance)); if (indexOfSmallestDistance != -1) { calcang2(playerIndex, localPlayer, GetBonePosition(boneIndex, indexOfSmallestDistance, bClient, vam), vam, bClient, bEngine, currentFov, currentThing, smoothing, this); if (aimbotautoshoot) { vam.WriteInt32((IntPtr)forceAttack, 6); } } #endregion #region First Index //int indexOfPlayerToAimAt = -99; //int i = 1; //do //{ // indexOfPlayerToAimAt = i - 1; // if (indexOfPlayerToAimAt == playerIndex) { i++; continue; } // if (currentThing == -1) // { // if (isAlive(indexOfPlayerToAimAt, vam, bClient)) // { // if (!isEntityByIdOnMyTeam(playerIndex, indexOfPlayerToAimAt, vam, bClient)) // { // int entity = vam.ReadInt32((IntPtr)(bClient + Offsets.oEntityList + (indexOfPlayerToAimAt) * Offsets.oEntityLoopDistance)); // if (map.IsVisible(localPlayer2, GetBonePosition(boneIndex, indexOfPlayerToAimAt, bClient, vam)) || map.IsVisible(localPlayer, GetBonePosition(boneIndex, indexOfPlayerToAimAt, bClient, vam)) || !spottedNeedsToBeTrue) // { // // if ((vam.ReadInt32((IntPtr)(entity + 0x97C)) & ( 1 << playerIndex)) == 1 || !spottedNeedsToBeTrue) // //{ // Angles angles = calcang2(playerIndex, localPlayer, GetBonePosition(boneIndex, indexOfPlayerToAimAt, bClient, vam), vam, bClient, bEngine, currentFov, currentThing, smoothing, this); // if (angles.x != 200) currentThing = indexOfPlayerToAimAt; // if (aimbotautoshoot) // { // vam.WriteInt32((IntPtr)forceAttack, 6); // } // //} // } // } // } // } // i++; //} while (i < 65); //currentThing = -1; #endregion } }