private Player AimbotLerpCrossUpdate() { if (Config.AimbotBasic.Key != 0 && GetAsyncKeyState((Keys)Config.AimbotBasic.Key) >= 0) { return(null); } var localPlayer = CheatMain.client.GetLocalPlayer(); if (localPlayer.Dead) { return(null); } var entityList = CheatMain.client.GetEntityList(); var plrWeapon = entityList.FindWeaponByID(localPlayer.ActiveWeaponID - 1); var cfgId = Array.IndexOf(Config.TriggerbotWeaponConfig.TriggerbotWeapons, (int)plrWeapon.WeaponID); if (cfgId == -1) { return(null); } var cfg = Config.AimbotBasic.WeaponsCfg[cfgId]; if (!cfg.Enabled) { return(null); } if (Enum.IsDefined(typeof(Snipers), (int)plrWeapon.WeaponID) && !localPlayer.Scoped) { return(null); } var crosshairPlr = entityList.FindPlayerByID(localPlayer.CrosshairID - 1); if (crosshairPlr == null) { return(null); } if (crosshairPlr.ClassId != ClassIDs.CCSPlayer) { return(null); } if (!Config.AimbotBasic.FFA && crosshairPlr.Team == localPlayer.Team) { return(null); } if (enemyFoundTicks < Config.AimbotBasic.DelayBefore) { return(crosshairPlr); } var view = CheatMain.clientState.ViewAngles; var target = crosshairPlr.GetBonePosition(8); var pos = localPlayer.ViewPosition; var dist = Vector3.Distance(pos, target); var targetView = Math3.CalcAngle(pos, target); //var targetFov = Math3.AngleBetweenVec2(view, targetView); var punch = localPlayer.PunchAngles; CheatMain.clientState.ViewAngles = Math3.Slerp(view, targetView - 2f * cfg.Rcs * punch, cfg.Smooth * .1f); return(crosshairPlr); }
private Player AimbotLerpFovUpdate() { if (Config.AimbotBasic.Key != 0 && GetAsyncKeyState((Keys)Config.AimbotBasic.Key) >= 0) { return(null); } var localPlayer = CheatMain.client.GetLocalPlayer(); if (localPlayer.Dead) { return(null); } var entityList = CheatMain.client.GetEntityList(); var plrWeapon = entityList.FindWeaponByID(localPlayer.ActiveWeaponID - 1); var cfgId = Array.IndexOf(Config.TriggerbotWeaponConfig.TriggerbotWeapons, (int)plrWeapon.WeaponID); if (cfgId == -1) { return(null); } var cfg = Config.AimbotBasic.WeaponsCfg[cfgId]; if (!cfg.Enabled) { return(null); } if (Enum.IsDefined(typeof(Snipers), (int)plrWeapon.WeaponID) && !localPlayer.Scoped) { return(null); } var view = CheatMain.clientState.ViewAngles; var players = entityList.FindVisiblePlayers(localPlayer); double fov; var targetPlr = entityList.FindFovPlayer(localPlayer, players, view - 2f * lastPunchAngles, out fov, Config.AimbotBasic.FFA, cfg.Bone); if (targetPlr == null) { return(null); } if (enemyFoundTicks < Config.AimbotBasic.DelayBefore) { return(targetPlr); } var target = targetPlr.GetBonePosition(cfg.Bone); var pos = localPlayer.ViewPosition; var dist = Vector3.Distance(pos, target); var targetView = Math3.CalcAngle(pos, target); var punch = localPlayer.PunchAngles; if (cfg.DynamicFov) { fov = Math3.GetDistanceFov((float)fov, (float)dist) * 1.4f; } if (fov <= cfg.Fov) { CheatMain.clientState.ViewAngles = Math3.Slerp(view, targetView - 2f * cfg.Rcs * punch, cfg.Smooth * .1f); } return(targetPlr); }