Иконка ресурса

FREE AntiCheatScience : 3.4.2 3.4.2

Нет прав для скачивания
C#:
// Все права принадлежат дискорд сообществу https://discord.gg/VgNHPpNrz6
using System;
using Oxide.Core;
using Oxide.Core.Libraries;
using Oxide.Core.Plugins;
using UnityEngine;
using Newtonsoft.Json;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Oxide.Game.Rust.Cui;
namespace Oxide.Plugins {
    [Info("AntiCheatScience", "https://discord.gg/TrJ7jnS233", "3.4.2")]
    [Description("Лучший анти чит для пиратского Rust | discord: pressfwd")]
    class AntiCheatScience : RustPlugin {
        [PluginReference]
        Plugin MultiFighting, Battles, AimTrain, ImageLibrary, NightVision;
#region Configuration
        private static ConfigData _config;
        public class ConfigData {
            public OtherConfig Global {
                get;
                set;
            }
            = new OtherConfig();
            public AimConfig Aim {
                get;
                set;
            }
            = new AimConfig();
            public PilotFireConfig PilotFire {
                get;
                set;
            }
            = new PilotFireConfig();
            public AimLockConfig AimLock {
                get;
                set;
            }
            = new AimLockConfig();
            public CodeLockConfig CodeLock {
                get;
                set;
            }
            = new CodeLockConfig();
            public NHDetect NightFire {
                get;
                set;
            }
            = new NHDetect();
            public ManipConfig Manipulator {
                get;
                set;
            }
            = new ManipConfig();
            public FlyFire FlyFire {
                get;
                set;
            }
            = new FlyFire();
            public MeleeAttackConfig MeleeAttack {
                get;
                set;
            }
            = new MeleeAttackConfig();
            public SAimConfig SilentAim {
                get;
                set;
            }
            = new SAimConfig();
            public FlyConfig FlyHack {
                get;
                set;
            }
            = new FlyConfig();
            public NFDConfig NoFallDamage {
                get;
                set;
            }
            = new NFDConfig();
            public SpiderConfig SpiderHack {
                get;
                set;
            }
            = new SpiderConfig();
            public StashConfig Traps {
                get;
                set;
            }
            = new StashConfig();
            public SteamProxyConfig Steam {
                get;
                set;
            }
            = new SteamProxyConfig();
            public LogAndConfig Logs {
                get;
                set;
            }
            = new LogAndConfig();
            public RAConfig RustAPP {
                get;
                set;
            }
            = new RAConfig();
        }
        public class OtherConfig {
            [JsonProperty("Консольная команда для блокировки? %steamid% - айди игрока , %reason% - причина")]
            public string BanCommand {
                get;
                set;
            }
            = "ban %steamid% \"%reason%\"";
            [JsonProperty("Консольная команда для кика? %steamid% - айди игрока , %reason% - причина")]
            public string KickCommand {
                get;
                set;
            }
            = "kick %steamid% \"%reason%\"";
            [JsonProperty("Дискорд айди тех.администратора (как его получить?: https://www.youtube.com/watch?v=9T0KqA8akrY | нет, видео не мое)")]
            public string DiscordID {
                get;
                set;
            }
            = "неизвестный";
            [JsonProperty("Блокировать урон при детекте?")]
            public bool isAimBlocDamage {
                get;
                set;
            }
            = false;
            [JsonProperty("Вы подтверждаете что плагин настроен? (версия 3.4.1)")]
            public bool isSettingsS {
                get;
                set;
            }
            = false;
            /*[JsonProperty("Максимум информации о вычислении и детектах в консоль?")]
            public bool isDetectDebug { get; set; } = false;*/
        }
        public class AimConfig {
            [JsonProperty("Причина бана/кика за AIM")]
            public string NameAim {
                get;
                set;
            }
            = "AC - Протокол #1!";
            [JsonProperty("Мера наказания за AIM RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
            public int banMeraAim {
                get;
                set;
            }
            = 1;
            [JsonIgnore]
            [JsonProperty("Мера наказания за AIM?(true - Бан, false - Кик)")]
            public bool isAimBan {
                get;
                set;
            }
            = true;
            public RifleConfig НастройкаВинтовок {
                get;
                set;
            }
            = new RifleConfig();
            public PistolConfig НастройкаПистолетов {
                get;
                set;
            }
            = new PistolConfig();
            public PPConfig НастройкаПП {
                get;
                set;
            }
            = new PPConfig();
            public SniperConfig НастройкаСнайперскихВинтовок {
                get;
                set;
            }
            = new SniperConfig();
            public BowConfig НастройкаЛуков {
                get;
                set;
            }
            = new BowConfig();
            public class RifleConfig {
                [JsonIgnore]
                [JsonProperty("За попадание в голову на сколько метров кикать? (Снайперки уже учтены)")]
                public float metrrifle {
                    get;
                    set;
                }
                = 220f;
                [JsonProperty("Секунд до сброса детектов?")]
                public float isTwoRifCD {
                    get;
                    set;
                }
                = 5;
                [JsonIgnore]
                [JsonProperty("Сколько попаданий за N сек в голову?")]
                public int isTwoRifH {
                    get;
                    set;
                }
                = 3;
                [JsonIgnore]
                [JsonProperty("Сколько попаданий за N сек в тело?")]
                public int isTwoRifB {
                    get;
                    set;
                }
                = 9;
            }
            public class PistolConfig {
                [JsonIgnore]
                [JsonProperty("За попадание в голову c пистолетов на сколько метров кикать?")]
                public float metrpistol {
                    get;
                    set;
                }
                = 140f;
                [JsonProperty("Секунд до сброса детектов?")]
                public float isTwoPistolCD {
                    get;
                    set;
                }
                = 5;
                [JsonIgnore]
                [JsonProperty("Сколько попаданий за N сек в голову?")]
                public int isTwoPistolH {
                    get;
                    set;
                }
                = 3;
                [JsonIgnore]
                [JsonProperty("Сколько попаданий за N сек в тело?")]
                public int isTwoPistolB {
                    get;
                    set;
                }
                = 6;
            }
            public class PPConfig {
                [JsonIgnore]
                [JsonProperty("За попадание в голову с ПП?")]
                public float metrpp {
                    get;
                    set;
                }
                = 180f;
                [JsonProperty("Секунд до сброса детектов?")]
                public float isTwoPPCD {
                    get;
                    set;
                }
                = 5;
                [JsonIgnore]
                [JsonProperty("Сколько попаданий за N сек в голову?")]
                public int isTwoPPH {
                    get;
                    set;
                }
                = 3;
                [JsonIgnore]
                [JsonProperty("Сколько попаданий за N сек в тело?")]
                public int isTwoPPB {
                    get;
                    set;
                }
                = 5;
            }
            public class SniperConfig {
                [JsonProperty("Float")]
                public float metrsniper {
                    get;
                    set;
                }
                = 500f;
            }
            public class BowConfig {
                [JsonIgnore]
                [JsonProperty("За попадание в голову c луков на сколько метров кикать?")]
                public float metrbow {
                    get;
                    set;
                }
                = 75f;
                [JsonProperty("Мера наказания?(true - Бан, false - Кик)")]
                public bool isbowBan {
                    get;
                    set;
                }
                = true;
                [JsonProperty("Секунд до сброса детектов?")]
                public float isTwoBowCD {
                    get;
                    set;
                }
                = 5;
                [JsonIgnore]
                [JsonProperty("Сколько попаданий за N сек в голову?")]
                public int isTwoBowH {
                    get;
                    set;
                }
                = 2;
                [JsonIgnore]
                [JsonProperty("Сколько попаданий за N сек в тело?")]
                public int isTwoBowB {
                    get;
                    set;
                }
                = 3;
            }
        }
        public class PilotFireConfig {
            [JsonProperty("Причина бана/кика за стрельбу с водительского места")]
            public string NameAimDrive {
                get;
                set;
            }
            = "AC - Протокол #2!";
            [JsonProperty("Мера наказания за стрельбу с вод.места RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
            public int banMeraAimDrive {
                get;
                set;
            }
            = 1;
        }
        public class AimLockConfig {
            [JsonProperty("Причина бана/кика за AimLock")]
            public string NameAimLock {
                get;
                set;
            }
            = "AC - Протокол #5!";
            [JsonProperty("Мера наказания за AimLock RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
            public int banMeraAimLock {
                get;
                set;
            }
            = 1;
            [JsonProperty("Мера наказания за AimLock?(true - Бан, false - Кик)")]
            public bool isAimLockBan {
                get;
                set;
            }
            = true;
        }
        public class CodeLockConfig {
            [JsonProperty("Причина детекта за ввод пароля от дома забаненого игрока")]
            public string NameCodeLock {
                get;
                set;
            }
            = "AC - Протокол #6!";
        }
        public class NHDetect {
            [JsonProperty("Логировать попадание в ночное время суток?")]
            public bool isNH {
                get;
                set;
            }
            = true;
            [JsonProperty("Расстояние для детекта")]
            public float metrnh {
                get;
                set;
            }
            = 100f;
            [JsonProperty("Причина детекта за попадание в ночное время")]
            public string NameNightShot {
                get;
                set;
            }
            = "AC - Протокол #9!";
        }
        public class ManipConfig {
            [JsonIgnore]
            [JsonProperty("Банить за тестовый детект манипулятора? (не мало жалоб за ложный бан, хотя видео док-ва не дают)")]
            public bool isManipT {
                get;
                set;
            }
            = true;
            [JsonProperty("Причина бана/кика за манипулятор")]
            public string NameAimM {
                get;
                set;
            }
            = "AC - Протокол #7!";
            [JsonProperty("Мера наказания за манипулятор RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
            public int banMeraAimM {
                get;
                set;
            }
            = 1;
        }
        public class FlyFire {
            [JsonProperty("Причина бана/кика за стрельбу в воздухе")]
            public string NameFlyFire {
                get;
                set;
            }
            = "AC - Протокол #8!";
            [JsonProperty("Мера наказания за стрельбу в воздухе RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
            public int banMeraFlyFire {
                get;
                set;
            }
            = 1;
        }
        public class MeleeAttackConfig {
            [JsonProperty("Причина бана/кика за MeleeAttack")]
            public string NameMeleeAttack {
                get;
                set;
            }
            = "AC - Протокол #10!";
            [JsonProperty("Мера наказания за MeleeAttack RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
            public int banMeraMeleeAttack {
                get;
                set;
            }
            = 1;
            [JsonProperty("Мера наказания за MeleeAttack?(true - Бан, false - Кик)")]
            public bool isMeleeAttackBan {
                get;
                set;
            }
            = true;
        }
        public class SAimConfig {
            [JsonProperty("Причина бана/кика за SilentAim")]
            public string NameSAim {
                get;
                set;
            }
            = "AC - Протокол #11!";
            [JsonProperty("Мера наказания за SilentAim RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
            public int banMeraSAim {
                get;
                set;
            }
            = 1;
            [JsonProperty("Кол-во детектов за 15 сек для бана")]
            public int maxDetect {
                get;
                set;
            }
            = 3;
            [JsonProperty("Мера наказания за SilentAim?(true - Бан, false - Кик)")]
            public bool isSAimBan {
                get;
                set;
            }
            = true;
        }
        public class FlyConfig {
            [JsonIgnore]
            [JsonProperty("Включить наказание за FlyHack?")]
            public bool isFly {
                get;
                set;
            }
            = true;
            [JsonIgnore]
            [JsonProperty("Мера наказания?(true - Бан, false - Кик)")]
            public bool isFlyBan {
                get;
                set;
            }
            = false;
            [JsonIgnore]
            [JsonProperty("За сколько детектов наказывать за FlyHack?")]
            public int DCount {
                get;
                set;
            }
            = 3;
            [JsonProperty("Причина бана/кика за FlyHack")]
            public string NameFly {
                get;
                set;
            }
            = "AC - Протокол #3!";
        }
        public class NFDConfig {
            [JsonProperty("Детектить? (BETA функционал)")]
            public bool isNFD {
                get;
                set;
            }
            = true;
            [JsonProperty("Причина бана/кика за NoFallDamage")]
            public string NameNFD {
                get;
                set;
            }
            = "AC - Протокол #12!";
            [JsonProperty("Мера наказания за NFD RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
            public int banMeraNFD {
                get;
                set;
            }
            = 1;
        }
        public class SpiderConfig {
            [JsonProperty("Детектить? (BETA функционал)")]
            public bool isSpider {
                get;
                set;
            }
            = true;
            [JsonProperty("Причина бана/кика за SpiderHack")]
            public string NameSpider {
                get;
                set;
            }
            = "AC - Протокол #13!";
            [JsonProperty("Мера наказания за SpiderHack RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
            public int banMeraSpider {
                get;
                set;
            }
            = 1;
        }
        public class StashConfig {
            [JsonProperty("Банить за откапывание чужих стешей?")]
            public bool isStash {
                get;
                set;
            }
            = true;
            [JsonProperty("Банить за откапывание N стешей")]
            public int stashBCount {
                get;
                set;
            }
            = 3;
            [JsonProperty("Причина бана/кика за откапывание чужих стешей")]
            public string NameStash {
                get;
                set;
            }
            = "AC - Протокол #4!";
            [JsonProperty("Мера наказания за стеши RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
            public int banMeraStash {
                get;
                set;
            }
            = 1;
        }
        public class SteamProxyConfig {
            [JsonProperty("Проверять игроков на Proxy через ip2location?")]
            public bool PROXY_CHECT {
                get;
                set;
            }
            = false;
            [JsonProperty("API Ключ для проверок IP игроков (https://www.ip2location.io/)")]
            public string YOUR_API_KEY {
                get;
                set;
            }
            = "000000";
            [JsonProperty("Проверять дату регистрации через steam?")]
            public bool STEAM_CHECT {
                get;
                set;
            }
            = false;
            [JsonProperty("API Ключ (ОБЯЗАТЕЛЬНО!!) https://steamcommunity.com/dev/apikey")]
            public string SteamAPI {
                get;
                set;
            }
            = "123123";
            [JsonProperty("Не пускать аккаунт если он создан мение N дней назад?")]
            public int SteamDays {
                get;
                set;
            }
            = 5;
            [JsonProperty("Пермишенс с которым можно зайти с молодого аккаунта")]
            public string SteamDaysIgnore {
                get;
                set;
            }
            = "ignoremolodoiacc";
        }
        public class LogAndConfig {
            [JsonProperty("Ссылка на вебхук Discord")]
            public string Webhook {
                get;
                set;
            }
            = "1";
            [JsonProperty("Картинка в логировании (версия стандартная)")]
            public string WebhookImage {
                get;
                set;
            }
            = "https://media.giphy.com/media/V4pAZ7bxf1rOFoLCWS/giphy.gif";
            /*[JsonProperty("Версия логирования? (true - стандартная | false - сразу и по делу(By MEGARGAN(не работает, я не успел доделать)))")]
            public bool LogVersion { get; set; } = true;*/
            /*[JsonProperty("Использовать дополнительный блок логирования?")]
            public bool steamlog { get; set; } = true;*/
        }
        public class RAConfig {
            [JsonProperty("Работать с RustAPP?")]
            public bool isRustAPP {
                get;
                set;
            }
            = false;
            [JsonProperty("Айди, репорт на которых отправить нельзя 765000000000000, 76500000000000001")]
            public List<string> idAntiReport {
                get;
                set;
            }
            = new List<string>();
            [JsonProperty("Банить автоматически если игрок получил N кол-во репортов?")]
            public bool isRustAPPbanAuto {
                get;
                set;
            }
            = false;
            [JsonProperty("Сколько репортов нужно получить для автоматического бана?")]
            public int banAutoInt {
                get;
                set;
            }
            = 5;
            [JsonProperty("Мера наказания за макс.репортов RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
            public int banMeraMR {
                get;
                set;
            }
            = 1;
            [JsonProperty("Банить только в RustAPP?")]
            public bool isRustAPPbanOnly {
                get;
                set;
            }
            = false;
        }
        protected override void LoadConfig() {
            base.LoadConfig();
            try {
                _config = Config.ReadObject<ConfigData>();
                if (_config == null) LoadDefaultConfig();
            }
            catch {
                Debug.LogError("[AntiCheatScience] ОШИБКА КОНФИГУРАЦИИ, ЗАГРУЗКА КОНФИГУРАЦИИ ПО УМОЛЧАНИЮ");
                LoadDefaultConfig();
            }
            NextTick(SaveConfig);
        }
        List<string> triggerWord = new List<string> {
            "bay", "pirate", "sliv", "fixed", "fix", "lick", "слив", "sliv", "слитые", "rustbay", "rustpirate", "skuli"
        }
        ;
        void OnPluginLoaded(Plugin plugin) {
            foreach (var pluginSliv in plugins.GetAll()) {
                if (pluginSliv.Author != null && pluginSliv.Author.ToLower().Contains(triggerWord.ToString()) || pluginSliv.Description != null && pluginSliv.Description.ToLower().Contains(triggerWord.ToString())) {
                    Debug.LogError("ФУ, МУСОРЩИК, УДАЛЯЙ СЛИТЫЕ ПЛАГИНЫ!!!");
                    Debug.LogError("ФУ, МУСОРЩИК, УДАЛЯЙ СЛИТЫЕ ПЛАГИНЫ!!");
                    Debug.LogError("ФУ, МУСОРЩИК, УДАЛЯЙ СЛИТЫЕ ПЛАГИНЫ!");
                    Debug.LogError("ФУ, МУСОРЩИК, УДАЛЯЙ СЛИТЫЕ ПЛАГИНЫ");
                    timer.Once(5f, () => {
                        Interface.Oxide.RootPluginManager.RemovePlugin(pluginSliv);
                        rust.RunServerCommand("quit");
                    }
                    );
                }
            }
        }
        private int MeleeDetect = 0;
        object OnMeleeAttack(BasePlayer player, HitInfo info) {
            if (info == null || info.HitEntity == null) return null;
            var hitPlayer = info.HitEntity as BasePlayer;
            if (hitPlayer == null || BasePlayer.sleepingPlayerList.Contains(hitPlayer)) return null;
            var parentEntity = player.GetParentEntity();
            if (parentEntity is CargoShip || parentEntity is BaseBoat || parentEntity is Horse || parentEntity is RidableHorse || parentEntity is HorseCorpse || parentEntity is Tugboat || parentEntity is ScrapTransportHelicopter || parentEntity is Minicopter || parentEntity is MiningQuarry) return null;
            if (hitPlayer.GetMountedVehicle() || player.GetMountedVehicle()) return null;
            if (MultiFighting != null) {
                if ((bool)MultiFighting.CallHook("IsSteam", player.Connection)) return null;
            }
            if (Battles != null) {
                if ((bool)Battles.CallHook("IsPlayerOnBattle", player.userID)) return null;
            }
            if (AimTrain != null) {
                if ((bool)AimTrain.CallHook("IsAimTraining", player.userID)) return null;
            }
            float distance = Vector3.Distance(player.transform.position, hitPlayer.transform.position);
            if (distance <= 0.9588763f) return null;
            if (info.HitEntity.IsNpc) return null;
            float num = 1f + ConVar.AntiHack.melee_forgiveness;
            float melee_clientframes = ConVar.AntiHack.melee_clientframes;
            float melee_serverframes = ConVar.AntiHack.melee_serverframes;
            float num2 = (player.desyncTimeClamped + melee_clientframes / 60f + melee_serverframes * Mathx.Max(UnityEngine.Time.deltaTime, UnityEngine.Time.smoothDeltaTime, UnityEngine.Time.fixedDeltaTime)) * num;
            Vector3 startPos = player.eyes.position;
            BaseMelee weapon = info.WeaponPrefab as BaseMelee;
            float maxDistance = weapon.maxDistance + weapon.attackRadius;
            float maxRadius = weapon.attackRadius + num2 * 0.5f;
            float maxHitDistance = maxDistance + num2 * 0.5f;
            RaycastHit hit;
            bool inRadius = Physics.SphereCast(startPos, maxRadius + 0.3f, player.eyes.BodyForward(), out hit, maxHitDistance, 2048 | 131072 | 1218519297, QueryTriggerInteraction.Ignore) && hit.collider.name.Contains("player");
            string weaponM = info.Weapon?.GetItem()?.info.shortname;
            if (weaponM.Contains("jackhammer") || weaponM.Contains("chainsaw") || weaponM.Contains("flash") || weaponM.Contains("torch")) return null;
            if (!inRadius) {
                player.stats.combat.LogInvalid(info, "Урон заблокирован АнтиЧитом");
                MeleeDetect++;
                DetectNo10(player, MeleeDetect, false);
                if (MeleeDetect == 1) {
                    timer.Once(30f, () => MeleeDetect = 0);
                }
                if (MeleeDetect == 3) {
                    DetectNo10(player, MeleeDetect, true);
                    if (_config.MeleeAttack.isMeleeAttackBan) {
                        if (_config.RustAPP.isRustAPP) {
                            if (_config.MeleeAttack.banMeraMeleeAttack == 1) {
                                rust.RunServerCommand($"ra.ban {player.userID.ToString()} \"{_config.MeleeAttack.NameMeleeAttack} [AntiCheatScience]\"");
                            }
                            else if (_config.MeleeAttack.banMeraMeleeAttack == 2) {
                                rust.RunServerCommand($"ra.ban {player.userID.ToString()} \"{_config.MeleeAttack.NameMeleeAttack} [AntiCheatScience]\" --global");
                            }
                            else if (_config.MeleeAttack.banMeraMeleeAttack == 3) {
                                rust.RunServerCommand($"ra.ban {player.userID.ToString()} \"{_config.MeleeAttack.NameMeleeAttack} [AntiCheatScience]\" --ban-ip");
                            }
                            else if (_config.MeleeAttack.banMeraMeleeAttack == 4) {
                                rust.RunServerCommand($"ra.ban {player.userID.ToString()} \"{_config.MeleeAttack.NameMeleeAttack} [AntiCheatScience]\" --ban-ip --global");
                            }
                        }
                        if (!_config.RustAPP.isRustAPPbanOnly) {
                            string commanda = _config.Global.BanCommand.Replace("%steamid%", player.userID.ToString()).Replace("%reason%", $"{_config.MeleeAttack.NameMeleeAttack} [AntiCheatScience]");
                            rust.RunServerCommand($"{commanda}");
                        }
                    }
                    else {
                        string commanda = _config.Global.KickCommand.Replace("%steamid%", player.userID.ToString()).Replace("%reason%", $"{_config.MeleeAttack.NameMeleeAttack} [AntiCheatScience]");
                        rust.RunServerCommand($"{commanda}");
                    }
                }
                if (_config.Global.isAimBlocDamage) {
                    return true;
                }
                return null;
            }
            return null;
        }
        /*private const string DummyPrefab = "assets/prefabs/player/player.prefab";
        private const float DummyDuration = 1f;
        private const float SpawnProbability = 0.15f;
        private BaseEntity dummyPlayer;
        private Vector3 spawnPosition;

        private void SpawnDummyPlayer(BasePlayer suspectPlayer)
        {
            if (dummyPlayer != null && !dummyPlayer.IsDestroyed)
            {
                dummyPlayer.Kill();
            }

            Vector3 forward = suspectPlayer.eyes.HeadForward();
            Vector3 left = Vector3.Cross(forward, Vector3.up).normalized;

            float forwardDistance = UnityEngine.Random.Range(5f, 6f); 
            float leftOffset = 0.7f; 

            spawnPosition = suspectPlayer.eyes.position + forward * forwardDistance + left * leftOffset;

            dummyPlayer = GameManager.server.CreateEntity(DummyPrefab, spawnPosition, suspectPlayer.eyes.rotation);
            if (dummyPlayer == null) return;

            dummyPlayer.Spawn();

            dummyPlayer.gameObject.AddComponent<DummyHitDetector>().Initialize(this, suspectPlayer);

            timer.Once(DummyDuration, () =>
            {
                if (dummyPlayer != null && !dummyPlayer.IsDestroyed)
                {
                    dummyPlayer.Kill();
                    dummyPlayer = null;
                }
            });
        }

        private class DummyHitDetector : MonoBehaviour
        {
            private AntiCheatScience plugin;
            private BasePlayer suspect;
            private int DummyDetect = 0;

            public void Initialize(AntiCheatScience plugin, BasePlayer suspect)
            {
                this.plugin = plugin;
                this.suspect = suspect;
            }

            private void OnCollisionEnter(Collision collision)
            {
                var hitPlayer = collision.gameObject.GetComponent<BasePlayer>();
                if (hitPlayer != null && hitPlayer == suspect)
                {
                    DummyDetect++;

                }
            }
        }*/
        protected override void LoadDefaultConfig() => _config = new ConfigData();
        protected override void SaveConfig() => Config.WriteObject(_config, true);
        Timer spiderTimer;
        private Dictionary<ulong, bool> playerReportsIQ = new Dictionary<ulong, bool>();
        private Dictionary<ulong, int> spiderDetectC = new Dictionary<ulong, int>();
        private string _Layer1 = "SpecMenu";
        void SpecMenu(BasePlayer adminPlayer, BasePlayer player) {
            CuiHelper.DestroyUi(adminPlayer, _Layer1);
            CuiElementContainer container = new CuiElementContainer();
            container.Add(new CuiPanel {
                CursorEnabled = false, Image = {
                    Color = "0 0 0 0"
                }
                , RectTransform = {
                    AnchorMin = "0.9 0.5", AnchorMax = "0.9 0.5", OffsetMin = "-400 -250", OffsetMax = "100 -50"
                }
            }
            , "Overlay", _Layer1);
            container.Add(new CuiElement {
                Parent = _Layer1, Components = {
                    new CuiRawImageComponent {
                        Png = (string) ImageLibrary.Call("GetImage", "bg")
                    }
                }
            }
            );
            container.Add(new CuiLabel {
                RectTransform = {
                    AnchorMin = "0.255 0.76", AnchorMax = "1 0.76", OffsetMin = "0 0", OffsetMax = "0 0"
                }
                , Text = {
                    Text = $"{player.displayName}", Align = TextAnchor.MiddleLeft, FontSize = 18, VerticalOverflow = VerticalWrapMode.Overflow
                }
            }
            , _Layer1);
            /*container.Add(new CuiLabel
            {
                RectTransform = { AnchorMin = "0.17 0.65", AnchorMax = "1 0.65", OffsetMin = "0 0", OffsetMax = "0 0" },
                Text = { Text = $"{banReason}", Align = TextAnchor.MiddleLeft, FontSize = 18, VerticalOverflow = VerticalWrapMode.Overflow }
            }, _Layer1);*/
            container.Add(new CuiElement {
                Parent = _Layer1, Name = "ban", Components = {
                    new CuiRawImageComponent {
                        Png = (string) ImageLibrary.Call("GetImage", "ban")
                    }
                    , new CuiRectTransformComponent {
                        AnchorMin = "0.2 0.2", AnchorMax = "0.2 0.2", OffsetMin = "-60 -20", OffsetMax = "60 20"
                    }
                }
            }
            );
            container.Add(new CuiButton {
                Button = {
                    Command = $"cmd.sosiban {player.UserIDString} {adminPlayer.UserIDString} \"Результат слежки\"", Color = "0 0 0 0"
                }
                , Text = {
                    Text = ""
                }
                , RectTransform = {
                    AnchorMin = "0.1 0.1", AnchorMax = "0.9 0.9"
                }
            }
            , "ban");
            container.Add(new CuiElement {
                Parent = _Layer1, Name = "stop", Components = {
                    new CuiRawImageComponent {
                        Png = (string) ImageLibrary.Call("GetImage", "stop")
                    }
                    , new CuiRectTransformComponent {
                        AnchorMin = "0.8 0.2", AnchorMax = "0.8 0.2", OffsetMin = "-60 -20", OffsetMax = "60 20"
                    }
                }
            }
            );
            container.Add(new CuiButton {
                Button = {
                    Command = "cmd.acspec stop", Color = "0 0 0 0"
                }
                , Text = {
                    Text = ""
                }
                , RectTransform = {
                    AnchorMin = "0.1 0.1", AnchorMax = "0.9 0.9"
                }
            }
            , "stop");
            /*container.Add(new CuiElement
            {
                Parent = _Layer1,
                Name = "HelpBtn",
                Components =
                {
                    new CuiRawImageComponent
                    {
                        Png = (string) ImageLibrary.Call("GetImage","helpbtn")
                    },
                    new CuiRectTransformComponent{AnchorMin = "0 0",AnchorMax = "0 0",OffsetMin = "5 245",OffsetMax = "145 325"}
                }
            });

            container.Add(new CuiButton
            {
                Button = { Command = "smhelpmenu", Color = "0 0 0 0"},
                Text = { Text = ""},
                RectTransform = { AnchorMin = "0.1 0.1",AnchorMax = "0.9 0.9"}
            }, "HelpBtn"); */
            /*container.Add(new CuiElement
            {
                Parent = _Layer1,
                Name = "ReportBtn",
                Components =
                {
                    new CuiRawImageComponent
                    {
                        Png = (string) ImageLibrary.Call("GetImage","reportbtn")
                    },
                    new CuiRectTransformComponent{AnchorMin = "0 0",AnchorMax = "0 0",OffsetMin = "5 170",OffsetMax = "145 250"}
                }
            });
            container.Add(new CuiButton
            {
                Button = { Command = "chat.say /report", Color = "0 0 0 0"},
                Text = { Text = ""},
                RectTransform = { AnchorMin = "0.1 0.1",AnchorMax = "0.9 0.9"}
            }, "ReportBtn");*/
            /*container.Add(new CuiElement
            {
                Parent = _Layer1,
                Name = "ChatBtn",
                Components =
                {
                    new CuiRawImageComponent
                    {
                        Png = (string) ImageLibrary.Call("GetImage","chatbtn")
                    },
                    new CuiRectTransformComponent{AnchorMin = "0 0",AnchorMax = "0 0",OffsetMin = "5 95",OffsetMax = "145 175"}
                }
            });

            container.Add(new CuiButton
            {
                Button = { Command = "chat.say /chat", Color = "0 0 0 0"},
                Text = { Text = ""},
                RectTransform = { AnchorMin = "0.1 0.1",AnchorMax = "0.9 0.9"}
            }, "ChatBtn");*/
            /*container.Add(new CuiElement
            {
                Parent = _Layer1,
                Name = "MenuBtn1",
                Components =
                {
                    new CuiRawImageComponent
                    {
                        Png = (string) ImageLibrary.Call("GetImage","menubtn")
                    },
                    new CuiRectTransformComponent{AnchorMin = "0 0",AnchorMax = "0 0",OffsetMin = "40 20",OffsetMax = "110 45"}
                }
            });
            container.Add(new CuiButton
            {
                Button = { Command = "smfirstmenu", Color = "0 0 0 0"},
                Text = { Text = ""},
                RectTransform = { AnchorMin = "0.1 0.1",AnchorMax = "0.9 0.9"}
            }, "MenuBtn1");*/
            CuiHelper.AddUi(adminPlayer, container);
        }
        void OnSendedReport(BasePlayer Sender, UInt64 TargetID, String Reason) {
            BasePlayer victim = BasePlayer.FindByID(TargetID);
            if (victim != null || victim != null && victim.IsAdmin) return;
            SeeSpider(victim);
        }
        void OnStartedChecked(BasePlayer Target, BasePlayer Moderator, Boolean IsConsole = false) {
            if (playerReportsIQ.ContainsKey(Target.userID)) {
                playerReportsIQ.Remove(Target.userID);
            }
        }
        void RustApp_OnCheckNoticeShowed(BasePlayer player) {
            if (playerReportsIQ.ContainsKey(player.userID)) {
                playerReportsIQ.Remove(player.userID);
            }
        }
        object OnConstructionPlace(BaseEntity entity, Construction component, Construction.Target constructionTarget, BasePlayer player) {
            if (playerReportsIQ.ContainsKey(player.userID)) {
                if (playerReportsIQ[player.userID]) {
                    if (spiderDetectC.ContainsKey(player.userID)) {
                        if (spiderDetectC[player.userID] != 0) {
                            if (entity.ToString().Contains("floor")) {
                                return "ты кого хочешь ноебать?";
                            }
                        }
                    }
                }
            }
            return null;
        }
        void SeeSpider(BasePlayer player) {
            if (!playerReportsIQ.ContainsKey(player.userID)) {
                playerReportsIQ.Add(player.userID, true);
            }
            if (_config.SpiderHack.isSpider) {
                Vector3 oldPos = player.transform.position;
                spiderTimer = timer.Every(0.5f, () => {
                    if (playerReportsIQ[player.userID]) {
                        /*if (!player.IsOnGround() && /*player.IsInWaterVolume || player.WaterFactor ||*/
                        /*player.IsRunning())
                        {
                            Puts("ебанат");
                        }*/
                        string nearbyObjects = GetNearbyObjects(player.transform.position, 1.5f);
                        if (HasForbiddenObjects(nearbyObjects)) {
                            return;
                        }
                        if (player.GetMountedVehicle()) {
                            if (!spiderTimer.Destroyed) spiderTimer.Destroy();
                            timer.Once(60f, () => {
                                SeeSpider(player);
                            }
                            );
                        }
                        if (playerReportsIQ[player.userID]) {
                            float cumulativeYIncrease = 0f;
                            Vector3 newPos = player.transform.position;
                            float deltaX = Mathf.Abs(newPos.x - oldPos.x);
                            float deltaY = newPos.y - oldPos.y;
                            float deltaZ = Mathf.Abs(newPos.z - oldPos.z);
                            if (deltaY > 0) {
                                cumulativeYIncrease += deltaY;
                            }
                            oldPos = newPos;
                            if (cumulativeYIncrease >= 0.7f && deltaX <= 0.7f && deltaZ <= 0.7f) {
                                if (!spiderDetectC.ContainsKey(player.userID)) {
                                    spiderDetectC.Add(player.userID, 0);
                                }
                                spiderDetectC[player.userID]++;
                                cumulativeYIncrease = 0f;
                                if (spiderDetectC[player.userID] >= 3) {
                                    DetectNo13(player);
                                    playerReportsIQ[player.userID] = false;
                                    if (!spiderTimer.Destroyed) spiderTimer.Destroy();
                                    if (_config.RustAPP.isRustAPP) {
                                        if (_config.SpiderHack.banMeraSpider == 1) {
                                            rust.RunServerCommand($"ra.ban {player.userID.ToString()} \"{_config.SpiderHack.NameSpider} [AntiCheatScience]\"");
                                        }
                                        else if (_config.SpiderHack.banMeraSpider == 2) {
                                            rust.RunServerCommand($"ra.ban {player.userID.ToString()} \"{_config.SpiderHack.NameSpider} [AntiCheatScience]\" --global");
                                        }
                                        else if (_config.SpiderHack.banMeraSpider == 3) {
                                            rust.RunServerCommand($"ra.ban {player.userID.ToString()} \"{_config.SpiderHack.NameSpider} [AntiCheatScience]\" --ban-ip");
                                        }
                                        else if (_config.SpiderHack.banMeraSpider == 4) {
                                            rust.RunServerCommand($"ra.ban {player.userID.ToString()} \"{_config.SpiderHack.NameSpider} [AntiCheatScience]\" --ban-ip --global");
                                        }
                                    }
                                    if (!_config.RustAPP.isRustAPPbanOnly) {
                                        string commanda = _config.Global.BanCommand.Replace("%steamid%", player.userID.ToString()).Replace("%reason%", _config.SpiderHack.NameSpider);
                                        rust.RunServerCommand($"{commanda}");
                                    }
                                    spiderDetectC[player.userID] = 0;
                                }
                            }
                            else {
                                if (deltaY <= 0) {
                                    cumulativeYIncrease = 0f;
                                }
                            }
                        }
                    }
                    else {
                        if (!spiderTimer.Destroyed) spiderTimer.Destroy();
                    }
                }
                );
            }
        }
        private Dictionary<string, int> playerReportsRA = new Dictionary<string, int>();
        object RustApp_CanIgnoreReport(string target_steam_id, string initiator_steam_id) {
            if (_config.RustAPP.idAntiReport.Contains(target_steam_id)) return false;
            if (UInt64.TryParse(target_steam_id, out ulong numValue)) {
                BasePlayer victim = BasePlayer.FindByID(numValue);
                SeeSpider(victim);
            }
            if (_config.RustAPP.isRustAPPbanAuto) {
                if (playerReportsRA.ContainsKey(target_steam_id)) {
                    playerReportsRA[target_steam_id]++;
                }
                else {
                    playerReportsRA.Add(target_steam_id, 1);
                }
                if (playerReportsRA[target_steam_id] == _config.RustAPP.banAutoInt) {
                    if (_config.RustAPP.isRustAPP) {
                        if (_config.RustAPP.banMeraMR == 1) {
                            rust.RunServerCommand($"ra.ban {target_steam_id} \"Привысил макс.кол-во репортов [AntiCheatScience]\"");
                        }
                        else if (_config.RustAPP.banMeraMR == 2) {
                            rust.RunServerCommand($"ra.ban {target_steam_id} \"Привысил макс.кол-во репортов [AntiCheatScience]\" --global");
                        }
                        else if (_config.RustAPP.banMeraMR == 3) {
                            rust.RunServerCommand($"ra.ban {target_steam_id} \"Привысил макс.кол-во репортов [AntiCheatScience]\" --ban-ip");
                        }
                        else if (_config.RustAPP.banMeraMR == 4) {
                            rust.RunServerCommand($"ra.ban {target_steam_id} \"Привысил макс.кол-во репортов [AntiCheatScience]\" --ban-ip --global");
                        }
                    }
                    if (!_config.RustAPP.isRustAPPbanOnly) {
                        string commanda = _config.Global.BanCommand.Replace("%steamid%", target_steam_id).Replace("%reason%", "Привысил макс.кол-во репортов [AntiCheatScience]");
                        rust.RunServerCommand($"{commanda}");
                    }
                }
            }
            return null;
        }
        Dictionary<ulong, float> Land = new Dictionary<ulong, float>();
        void OnPlayerLanded(BasePlayer player, float num) {
            if (!_config.NoFallDamage.isNFD) return;
            NextTick(() => {
                if (!(Math.Abs(player.Health() - Math.Abs(Land[player.userID])) > 5)) {
                    NoFallDamage(player);
                }
            }
            );
        }
        object OnPlayerLand(BasePlayer player, float num) {
            if (!_config.NoFallDamage.isNFD) return null;
            if (!Land.ContainsKey(player.userID)) {
                Land.Add(player.userID, player.Health());
            }
            else {
                Land[player.userID] = player.Health();
            }
            return null;
        }
        Dictionary<ulong, int> JA = new Dictionary<ulong, int>();
        Dictionary<ulong, int> JAReserve = new Dictionary<ulong, int>();
        Dictionary<ulong, int> JA_detect = new Dictionary<ulong, int>();
        Dictionary<ulong, int> JAReserve_detect = new Dictionary<ulong, int>();
        Dictionary<ulong, bool> cdJ = new Dictionary<ulong, bool>();
        private Dictionary<ulong, List<JumpInfo>> playerJumps = new Dictionary<ulong, List<JumpInfo>>();
        private class JumpInfo {
            public float Time;
            public Vector3 Position;
            public JumpInfo(float time, Vector3 position) {
                Time = time;
                Position = position;
            }
        }
        Timer checktimerJ;
        private void OnPlayerInput(
// ... [Code preview truncated due to length. Full source in attached file] ...

Автор
15FPS
Скачиваний
0
Просмотры
1
Первый выпуск
Обновление
Оценка
0.00 звёзд 0 оценок
Сверху