private static void MainThread() { Main m = Main.getInstance(); m.log("Main Thread Started"); m.log("A:" + aimbot.ToString()); AimBotController aimbotController = new AimBotController(); if (Modules.IsModuleRunning(Modules.ClientDLLName)) { while (true) { if (CLocalPlayer.IsPlaying) { #region Aimbot-Start if (aimbot) { aimbotController.setFrom(CLocalPlayer.Position); } #endregion #region PlayerLoop for (int i = 0; i <= EngineClient.MaxPlayer; i++) { #region Entity Cheats int EntBase = CylMem.ReadInt(Modules.ClientDLLAdress + dwEntityList + i * 0x10); if (EntBase == 0) { continue; } if (CEntityPlayer.isDormant(EntBase)) { continue; } #region Aimbot-GetClosestPlayer int health = CEntityPlayer.Health(EntBase); Teams team = CEntityPlayer.Team(EntBase); if (CheatStatus.AimbotActive && team != CLocalPlayer.Team && team != Teams.SPECTATOR && team != Teams.NONE && CEntityPlayer.isAlive(EntBase) && health > 0 && health <= 100 ) { aimbotController.closestEngine(EntBase, CEntityPlayer.Position(EntBase)); } #endregion #endregion } #region Aimbot-Target if (aimbot) { int target_aim_entbase = aimbotController.closestPlayerEntityBase; Vector3 target_aim_vector = aimbotController.closestPlayerVector; if (CEntityPlayer.isPlayerSpotted(target_aim_entbase) && Methods.HoldingKey(Keys.LButton)) { Vector3 raw = aimbotController.CalcAngle(target_aim_vector); Vector3 raw_unp = aimbotController.RemovePunch(raw); Vector3 target_angle = Parsers.ClampAngle(raw_unp); CLocalPlayer.ViewAngles = target_angle; //m.log( // String.Format("Closest Player x:{0} y:{1} z:{2} Distance : {3}", target_aim_vector.X, target_aim_vector.Y, target_aim_vector.Z,aimbotController.target_distance), // "Aimbot Closest" // ); //m.log( // String.Format("Angle x:{0} y:{1} z:{2} Distance : {3}", raw_unp.X, raw_unp.Y, raw_unp.Z, aimbotController.target_distance), // "Aimbot Closest" // ); } } #endregion #endregion } } } }