public static bool Silent(PlayerProjectileAttack attack) { if (Instance.TargetPlayer != null) { EHumanBone typeHit = OpCodes.GetTargetHit(0, Settings.Aimbot_Range_Manual_AutoHeadshot); var hitPosition = Instance.TargetPlayer.Position + new Vector3(0, 50, 0); var distance = Vector3.Distance(LocalPlayer.EyePos, hitPosition); var distance2 = Vector3.Distance(LocalPlayer.Position, attack.playerAttack.attack.hitPositionWorld); // ConsoleSystem.Log("Distance2 => " +distance2); // ConsoleSystem.Log("Distance => " +GetTimeout(FiredProjectiles[attack.playerAttack.projectileID], distance2)); float timeout = 0; if (distance2 < distance) { timeout = GetTimeout(FiredProjectiles[attack.playerAttack.projectileID], distance - distance2); } if (timeout <= 0) { timeout = 0.001f; } ConsoleSystem.LogWarning("[Silent] Sleep => " + timeout); var player = Instance.TargetPlayer; var attackCopy = attack.Copy(); SapphireEngine.Functions.Timer.SetTimeout(() => SendRangeAttack(player, typeHit, attackCopy, hitPosition), timeout); return(true); } return(false); }
private bool RPC_OnPlayerAttack(ERPCNetworkType type, Message message) { if (MeleeAim.HasCooldown() || AutoGather.HasCooldown()) { return(true); } using (PlayerAttack playerAttack = PlayerAttack.Deserialize(message.read)) { var attack = playerAttack.attack; if (attack.hitID == 0) { return(true); } #region [BaseResource] var resource = Get <BaseResource>(attack.hitID); if (resource != null) { attack.hitItem = 0; attack.hitBone = 0; attack.hitPartID = 0; var pos = Settings.ManualGather_Bonus ? resource.GetHitPosition() : resource.Position; // Если это OreResource if (pos != resource.Position) { attack.hitPositionWorld = pos; attack.hitNormalWorld = pos; } AutoGather.SetCooldown((EPrefabUID)PrefabID); if (VirtualServer.BaseClient.write.Start()) { VirtualServer.BaseClient.write.PacketID(Message.Type.RPCMessage); VirtualServer.BaseClient.write.EntityID(this.UID); VirtualServer.BaseClient.write.UInt32((UInt32)ERPCMethodUID.PlayerAttack); PlayerAttack.Serialize(VirtualServer.BaseClient.write, playerAttack); VirtualServer.BaseClient.Send(); return(true); } } #endregion #region [BasePlayer] if (Settings.Aimbot_Melee_Manual) { var player = Get <BasePlayer>(playerAttack.attack.hitID); if (player != null) { var typeHit = OpCodes.GetTargetHit((EHumanBone)attack.hitBone, Settings.Aimbot_Melee_Manual_AutoHeadshot); MeleeAim.SetCooldown((EPrefabUID)this.PrefabID); return(SendMeleeAttack(player, typeHit, player.Position)); } } #endregion } return(false); }
public static bool Manual(PlayerProjectileAttack attack) { if (Instance.TargetPlayer != null) { EHumanBone typeHit = OpCodes.GetTargetHit((EHumanBone)attack.playerAttack.attack.hitBone, Settings.Aimbot_Range_Manual_AutoHeadshot); SendRangeAttack(Instance.TargetPlayer, typeHit, attack, Instance.TargetPlayer.Position); return(true); } return(false); }
// Token: 0x0600012A RID: 298 RVA: 0x0000A22C File Offset: 0x0000842C public static bool Manual(PlayerProjectileAttack attack) { bool flag = RangeAim.Instance.TargetPlayer != null; bool result; if (flag) { EHumanBone typeHit = OpCodes.GetTargetHit((EHumanBone)attack.playerAttack.attack.hitBone, Settings.Aimbot_Range_Manual_AutoHeadshot); RangeAim.SendRangeAttack(RangeAim.Instance.TargetPlayer, typeHit, attack, RangeAim.Instance.TargetPlayer.Position); result = true; } else { result = false; } return(result); }
public override void OnUpdate() { if (Settings.Aimbot_Melee_Silent && BasePlayer.IsHaveLocalPlayer && BasePlayer.LocalPlayer.CanInteract()) { if (!BasePlayer.LocalPlayer.HasActiveItem || !BasePlayer.LocalPlayer.ActiveItem.IsMelee()) { // При отсутсвии в руках оружия ближнего боя, ставим кд 1, чтобы при смене оружия не было CooldownHack SetCooldown(1f); return; } m_Interval += DeltaTime; m_Cooldown -= DeltaTime; var prefabId = (EPrefabUID)BasePlayer.LocalPlayer.ActiveItem.PrefabID; var speed = GetMeleeSpeed(prefabId); // Если меняем оружие ближнего боя, то ставим кд 1, чтобы при смене оружие не было CooldownHack if (LastMeleePrefabUID != BasePlayer.LocalPlayer.ActiveItem.PrefabID) { LastMeleePrefabUID = BasePlayer.LocalPlayer.ActiveItem.PrefabID; SetCooldown(1f); return; } if (m_Interval > speed && m_Cooldown < 0) { m_Interval = 0; var maxDistance = OpCodes.GetMeleeMaxDistance(prefabId); BasePlayer target = BasePlayer.FindEnemy(maxDistance); if (target != null) { // При успешной атаке, ставим кд равное максимальной скорости атаки данного оружия SetCooldown(speed); var bone = OpCodes.GetTargetHit(0, Settings.Aimbot_Melee_Silent_AutoHeadshot); var attackInfo = OpCodes.GetTargetHitInfo(bone); var closestPoint = target.ClosestPoint(BasePlayer.LocalPlayer.EyePos); var offset = BasePlayer.LocalPlayer.GetForward(closestPoint) * 1.4f; DDraw.DrawBox(target.WorldSpaceBounds().position, target.WorldSpaceBounds().extents * 2, Color.magenta, 1f); DDraw.Arrow(closestPoint, closestPoint - offset, 0.1f, Color.blue, 1f); var position = closestPoint - offset; BasePlayer.LocalPlayer.ActiveItem.SendMeleeAttack(target, bone, position); } } } }
// Token: 0x06000129 RID: 297 RVA: 0x0000A110 File Offset: 0x00008310 public static bool Silent(PlayerProjectileAttack attack) { bool aimbot_Range_Manual_AutoHeadshot = Settings.Aimbot_Range_Manual_AutoHeadshot; if (aimbot_Range_Manual_AutoHeadshot) { } bool flag = RangeAim.Instance.TargetPlayer != null; bool result; if (flag) { EHumanBone typeHit = OpCodes.GetTargetHit((EHumanBone)0u, Settings.Aimbot_Range_Manual_AutoHeadshot); Vector3 hitPosition = RangeAim.Instance.TargetPlayer.Position; float distance = Vector3.Distance(RangeAim.LocalPlayer.EyePos, hitPosition); float distance2 = Vector3.Distance(RangeAim.LocalPlayer.Position, attack.playerAttack.attack.hitPositionWorld); float timeout = 0f; bool flag2 = distance2 < distance; if (flag2) { timeout = RangeAim.GetTimeout(RangeAim.FiredProjectiles[attack.playerAttack.projectileID], distance - distance2); } bool flag3 = timeout <= 0f; if (flag3) { timeout = 0.001f; } BasePlayer player = RangeAim.Instance.TargetPlayer; PlayerProjectileAttack attackCopy = attack.Copy(); Timer.SetTimeout(delegate { RangeAim.SendRangeAttack(player, typeHit, attackCopy, hitPosition); }, timeout); result = true; } else { result = false; } return(result); }