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;
using Facepunch.Extend;
using System.Collections;
using UnityEngine.Networking;
namespace Oxide.Plugins {
[Info("AntiCheatScience", "PRESSF | https://hazard-plugins.space", "3.6.2")]
[Description("The best anti-cheat for piratedRust | discord: pressfwd")]
class AntiCheatScience : RustPlugin {
[PluginReference]
Plugin MultiFighting, Battles, AimTrain, ImageLibrary, NightVision, RustApp, AutoBattleMetricsBan, FreePlayerFriendly, FLuma;
#region Configuration
const bool LangEN = true;
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 ModelStateConfig ModelState {
get;
set;
}
= new ModelStateConfig();
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 BMConfig BattleMetrics {
get;
set;
}
= new BMConfig();
public DBConfig DataBase {
get;
set;
}
= new DBConfig();
}
public class OtherConfig {
[JsonProperty(LangEN ? "Console command for ban? %steamid% - player id , %reason% - ban reason" : "Console command to Ban Player? %steamid% - playerID , %reason% - Reason")]
public string BanCommand {
get;
set;
}
= "ban %steamid% \"%reason%\"";
[JsonProperty(LangEN ? "Console command for kick? %steamid% - player id , %reason% - kick reason" : "Console command for kick? %steamid% - playerID , %reason% - Reason")]
public string KickCommand {
get;
set;
}
= "kick %steamid% \"%reason%\"";
[JsonProperty(LangEN ? "Discord ID of the tech admin (how to get it?: https://www.youtube.com/watch?v=9T0KqA8akrY | no, the video is not mine)" : "Discord ID of the tech admin (how to get it?: https://www.youtube.com/watch?v=9T0KqA8akrY | no, the video is not mine)")]
public string DiscordID {
get;
set;
}
= "unknown";
[JsonProperty(LangEN ? "Block damage on detection?" : "Block damage on detection?")]
public bool isAimBlocDamage {
get;
set;
}
= false;
[JsonProperty(LangEN ? "Confirm that the plugin is configured? (version 3.6.2)" : "Confirm that the plugin is configured? (version 3.6.2)")]
public bool isSettingsS {
get;
set;
}
= false;
}
public class AimConfig {
[JsonProperty(LangEN ? "Ban/kick reason for AIM" : "Ban/kick reason for AIM")]
public string NameAim {
get;
set;
}
= "AC - Protocol #1!";
[JsonProperty(LangEN ? "Punishment measure for AIM RustAPP (1 - Ban, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP)" : "Punishment measure for AIM RustAPP (1 - Ban, 2 - Ban on all servers, 3 - On server by IP, 4 - on all server by IP")]
public int banMeraAim {
get;
set;
}
= 1;
[JsonProperty(LangEN ? "Punishment measure for AIM?(true - Ban, false - Kick)" : "Punishment measure for AIM?(true - Бан, false - Kick)")]
public bool isAimBan {
get;
set;
}
= true;
[JsonProperty(LangEN ? "Use function?" : "Use function?")]
public bool isAim {
get;
set;
}
= true;
public RifleConfig RifleSettings {
get;
set;
}
= new RifleConfig();
public PistolConfig PistolSettings {
get;
set;
}
= new PistolConfig();
public PPConfig PPSetings {
get;
set;
}
= new PPConfig();
public SniperConfig SniperRifleSettings {
get;
set;
}
= new SniperConfig();
public BowConfig BowSettings {
get;
set;
}
= new BowConfig();
}
public class RifleConfig {
[JsonIgnore]
[JsonProperty(LangEN ? "Kick for headshot from how many meters? (Sniper rifles are already considered)" : "Kick for headshot from how many meters? (Sniper rifles are already considered)")]
public float metrrifle {
get;
set;
}
= 220f;
[JsonProperty(LangEN ? "Seconds until detection reset?" : "Seconds until detection reset?")]
public float isTwoRifCD {
get;
set;
}
= 5;
[JsonIgnore]
[JsonProperty(LangEN ? "Number of headshots in N seconds?" : "Number of headshots in N seconds?")]
public int isTwoRifH {
get;
set;
}
= 3;
[JsonIgnore]
[JsonProperty(LangEN ? "Number of body shots in N seconds?" : "Number of body shots in N seconds?")]
public int isTwoRifB {
get;
set;
}
= 9;
}
string url;
string note;
public class PistolConfig {
[JsonIgnore]
[JsonProperty(LangEN ? "Kick for headshot from pistols from how many meters?" : "Kick for headshot from pistols from how many meters?")]
public float metrpistol {
get;
set;
}
= 140f;
[JsonProperty(LangEN ? "Seconds until detection reset?" : "Seconds until detection reset?")]
public float isTwoPistolCD {
get;
set;
}
= 5;
[JsonIgnore]
[JsonProperty(LangEN ? "Number of headshots in N seconds?" : "Number of headshots in N seconds?")]
public int isTwoPistolH {
get;
set;
}
= 3;
[JsonIgnore]
[JsonProperty(LangEN ? "Number of body shots in N seconds?" : "Number of body shots in N seconds?")]
public int isTwoPistolB {
get;
set;
}
= 6;
}
public class PPConfig {
[JsonIgnore]
[JsonProperty(LangEN ? "Kick for headshot from SMGs from how many meters?" : "Kick for headshot from SMGs from how many meters?")]
public float metrpp {
get;
set;
}
= 180f;
[JsonProperty(LangEN ? "Seconds until detection reset?" : "Seconds until detection reset?")]
public float isTwoPPCD {
get;
set;
}
= 5;
[JsonIgnore]
[JsonProperty(LangEN ? "Number of headshots in N seconds?" : "Number of headshots in N seconds?")]
public int isTwoPPH {
get;
set;
}
= 3;
[JsonIgnore]
[JsonProperty(LangEN ? "Number of body shots in N seconds?" : "Number of body shots in N seconds?")]
public int isTwoPPB {
get;
set;
}
= 5;
}
public class SniperConfig {
[JsonProperty(LangEN ? "Float" : "Float")]
public float metrsniper {
get;
set;
}
= 500f;
}
public class BowConfig {
[JsonIgnore]
[JsonProperty(LangEN ? "Kick for headshot from bows from how many meters?" : "Kick for headshot from bows from how many meters?")]
public float metrbow {
get;
set;
}
= 75f;
[JsonProperty(LangEN ? "Punishment measure?(true - Ban, false - Kick)" : "Punishment measure?(true - Ban, false - Kick)")]
public bool isbowBan {
get;
set;
}
= true;
[JsonProperty(LangEN ? "Seconds until detection reset?" : "Seconds until detection reset?")]
public float isTwoBowCD {
get;
set;
}
= 5;
[JsonIgnore]
[JsonProperty(LangEN ? "Number of headshots in N seconds?" : "Number of headshots in N seconds?")]
public int isTwoBowH {
get;
set;
}
= 2;
[JsonIgnore]
[JsonProperty(LangEN ? "Number of body shots in N seconds?" : "Number of body shots in N seconds?")]
public int isTwoBowB {
get;
set;
}
= 3;
}
public class PilotFireConfig {
[JsonProperty(LangEN ? "Ban/kick reason for shooting from driver's seat" : "Ban/kick reason for shooting from driver's seat")]
public string NameAimDrive {
get;
set;
}
= "AC - Protocol #2!";
[JsonProperty(LangEN ? "Punishment measure for shooting from driver's seat RustAPP (1 - Ban, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP)" : "Punishment measure for shooting from driver's seat RustAPP (1 - Бан, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP")]
public int banMeraAimDrive {
get;
set;
}
= 1;
[JsonProperty(LangEN ? "Use function?" : "Use Function?")]
public bool isPF {
get;
set;
}
= true;
}
public class AimLockConfig {
[JsonProperty(LangEN ? "Ban/kick reason for AimLock" : "Ban/kick reason for AimLock")]
public string NameAimLock {
get;
set;
}
= "AC - Protocol #5!";
[JsonProperty(LangEN ? "Punishment measure for AimLock RustAPP (1 - Ban, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP)" : "Punishment measure for AimLock RustAPP (1 - Бан, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP")]
public int banMeraAimLock {
get;
set;
}
= 1;
[JsonProperty(LangEN ? "Punishment measure for AimLock?(true - Ban, false - Kick)" : "Punishment measure for AimLock?(true - Ban, false - kick)")]
public bool isAimLockBan {
get;
set;
}
= true;
[JsonProperty(LangEN ? "Use func?" : "Use Function?")]
public bool isAimLock {
get;
set;
}
= true;
}
public class CodeLockConfig {
[JsonProperty(LangEN ? "Detection reason for entering the code of a banned player's house" : "Detection reason for entering the code of a banned player's house")]
public string NameCodeLock {
get;
set;
}
= "AC - Protocol #6!";
[JsonProperty(LangEN ? "Use func?" : "Use Function?")]
public bool isCodeLock {
get;
set;
}
= true;
}
public class NHDetect {
[JsonProperty(LangEN ? "Log hit at night?" : "Log hit at night?")]
public bool isNH {
get;
set;
}
= true;
[JsonProperty(LangEN ? "Detection distance" : "Расстояние для детекта")]
public float metrnh {
get;
set;
}
= 100f;
[JsonProperty(LangEN ? "Detection reason for hit at night" : "Причина детекта за попадание в ночное время")]
public string NameNightShot {
get;
set;
}
= "AC - Protocol #9!";
}
public class ManipConfig {
[JsonIgnore]
[JsonProperty(LangEN ? "Ban for test manipulator detection? (not few complaints for false ban, although no video evidence)" : "Банить за тестовый детект манипулятора? (не мало жалоб за ложный бан, хотя видео док-ва не дают)")]
public bool isManipT {
get;
set;
}
= true;
[JsonProperty(LangEN ? "Ban/kick reason for manipulator" : "Причина бана/кика за манипулятор")]
public string NameAimM {
get;
set;
}
= "AC - Protocol #7!";
[JsonProperty(LangEN ? "Punishment measure for manipulator RustAPP (1 - Ban, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP)" : "Мера наказания за манипулятор RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
public int banMeraAimM {
get;
set;
}
= 1;
[JsonProperty(LangEN ? "Use function?" : "Использовать функцию?")]
public bool isManip {
get;
set;
}
= true;
}
public class FlyFire {
[JsonProperty(LangEN ? "Ban/kick reason for shooting in the air" : "Причина бана/кика за стрельбу в воздухе")]
public string NameFlyFire {
get;
set;
}
= "AC - Protocol #8!";
[JsonProperty(LangEN ? "Punishment measure for shooting in the air RustAPP (1 - Ban, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP)" : "Мера наказания за стрельбу в воздухе RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
public int banMeraFlyFire {
get;
set;
}
= 1;
[JsonProperty(LangEN ? "Use function?" : "Использовать функцию?")]
public bool isFF {
get;
set;
}
= true;
}
public class MeleeAttackConfig {
[JsonProperty(LangEN ? "Ban/kick reason for MeleeAttack" : "Причина бана/кика за MeleeAttack")]
public string NameMeleeAttack {
get;
set;
}
= "AC - Protocol #10!";
[JsonProperty(LangEN ? "Punishment measure for MeleeAttack RustAPP (1 - Ban, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP)" : "Мера наказания за MeleeAttack RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
public int banMeraMeleeAttack {
get;
set;
}
= 1;
[JsonProperty(LangEN ? "Punishment measure for MeleeAttack?(true - Ban, false - Kick)" : "Мера наказания за MeleeAttack?(true - Бан, false - Кик)")]
public bool isMeleeAttackBan {
get;
set;
}
= true;
[JsonProperty(LangEN ? "Use function? (NOW IN BETA TEST (FROM 29.08.2024))" : "Использовать функцию? (NOW IN BETA TEST (FROM 29.08.2024))")]
public bool isMA {
get;
set;
}
= true;
}
public class SAimConfig {
[JsonProperty(LangEN ? "Ban/kick reason for SilentAim" : "Причина бана/кика за SilentAim")]
public string NameSAim {
get;
set;
}
= "AC - Protocol #11!";
[JsonProperty(LangEN ? "Punishment measure for SilentAim RustAPP (1 - Ban, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP)" : "Мера наказания за SilentAim RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
public int banMeraSAim {
get;
set;
}
= 1;
[JsonProperty(LangEN ? "Number of detections in 15 seconds for ban" : "Кол-во детектов за 15 сек для бана")]
public int maxDetect {
get;
set;
}
= 3;
[JsonProperty(LangEN ? "Punishment measure for SilentAim?(true - Ban, false - Kick)" : "Мера наказания за SilentAim?(true - Бан, false - Кик)")]
public bool isSAimBan {
get;
set;
}
= true;
[JsonProperty(LangEN ? "Use function?" : "Использовать функцию?")]
public bool isSA {
get;
set;
}
= true;
}
public class FlyConfig {
[JsonIgnore]
[JsonProperty(LangEN ? "Enable punishment for FlyHack?" : "Включить наказание за FlyHack?")]
public bool isFly {
get;
set;
}
= true;
[JsonIgnore]
[JsonProperty(LangEN ? "Punishment measure?(true - Ban, false - Kick)" : "Мера наказания?(true - Бан, false - Кик)")]
public bool isFlyBan {
get;
set;
}
= false;
[JsonIgnore]
[JsonProperty(LangEN ? "Number of detections for FlyHack punishment?" : "За сколько детектов наказывать за FlyHack?")]
public int DCount {
get;
set;
}
= 3;
[JsonProperty(LangEN ? "Ban/kick reason for FlyHack" : "Причина бана/кика за FlyHack")]
public string NameFly {
get;
set;
}
= "AC - Protocol #3!";
}
public class NFDConfig {
[JsonProperty(LangEN ? "Detect? (BETA functionality)" : "Детектить? (BETA функционал)")]
public bool isNFD {
get;
set;
}
= false;
[JsonProperty(LangEN ? "Ban/kick reason for NoFallDamage" : "Причина бана/кика за NoFallDamage")]
public string NameNFD {
get;
set;
}
= "AC - Protocol #12!";
[JsonProperty(LangEN ? "Punishment measure for NFD RustAPP (1 - Ban, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP)" : "Мера наказания за NFD RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
public int banMeraNFD {
get;
set;
}
= 1;
}
public class SpiderConfig {
[JsonProperty(LangEN ? "Detect? (BETA functionality)" : "Детектить? (BETA функционал)")]
public bool isSpider {
get;
set;
}
= false;
[JsonProperty(LangEN ? "Ban/kick reason for SpiderHack" : "Причина бана/кика за SpiderHack")]
public string NameSpider {
get;
set;
}
= "AC - Protocol #13!";
[JsonProperty(LangEN ? "Punishment measure for SpiderHack RustAPP (1 - Ban, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP)" : "Мера наказания за SpiderHack RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
public int banMeraSpider {
get;
set;
}
= 1;
}
public class ModelStateConfig {
[JsonProperty(LangEN ? "Detect? (BETA functionality)" : "Детектить? (BETA функционал)")]
public bool isModelState {
get;
set;
}
= false;
[JsonProperty(LangEN ? "Enable auto check of the entire server once every time?" : "Включить авто проверку всего сервера раз в какое то время?")]
public bool isModelStateAuto {
get;
set;
}
= true;
[JsonProperty(LangEN ? "Ban/kick reason for ModelState" : "Причина бана/кика за ModelState")]
public string NameMS {
get;
set;
}
= "AC - Protocol #14!";
[JsonProperty(LangEN ? "Punishment measure for SpiderHack RustAPP (1 - Ban, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP)" : "Мера наказания за SpiderHack RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
public int banMeraMS {
get;
set;
}
= 1;
}
public class StashConfig {
[JsonProperty(LangEN ? "Ban for digging up someone else's stashes?" : "Банить за откапывание чужих стешей?")]
public bool isStash {
get;
set;
}
= true;
[JsonProperty(LangEN ? "Ban for digging up N stashes" : "Банить за откапывание N стешей")]
public int stashBCount {
get;
set;
}
= 3;
[JsonProperty(LangEN ? "Ban/kick reason for digging up someone else's stashes" : "Причина бана/кика за откапывание чужих стешей")]
public string NameStash {
get;
set;
}
= "AC - Protocol #4!";
[JsonProperty(LangEN ? "Punishment measure for stashes RustAPP (1 - Ban, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP)" : "Мера наказания за стеши RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
public int banMeraStash {
get;
set;
}
= 1;
}
public class SteamProxyConfig {
[JsonProperty(LangEN ? "Check players for Proxy through ip2location?" : "Проверять игроков на Proxy через ip2location?")]
public bool PROXY_CHECT {
get;
set;
}
= false;
[JsonProperty(LangEN ? "API Key for player IP checks (https://www.ip2location.io/)" : "API Ключ для проверок IP игроков (https://www.ip2location.io/)")]
public string YOUR_API_KEY {
get;
set;
}
= "000000";
[JsonProperty(LangEN ? "Check registration date through steam?" : "Проверять дату регистрации через steam?")]
public bool STEAM_CHECT {
get;
set;
}
= false;
[JsonProperty(LangEN ? "API Key (REQUIRED!!) https://steamcommunity.com/dev/apikey" : "API Ключ (ОБЯЗАТЕЛЬНО!!) https://steamcommunity.com/dev/apikey")]
public string SteamAPI {
get;
set;
}
= "123123";
[JsonProperty(LangEN ? "Do not allow the account if it was created less than N days ago?" : "Не пускать аккаунт если он создан мение N дней назад?")]
public int SteamDays {
get;
set;
}
= 5;
[JsonProperty(LangEN ? "Permission with which you can enter with a young account" : "Пермишенс с которым можно зайти с молодого аккаунта")]
public string SteamDaysIgnore {
get;
set;
}
= "ignoremolodoiacc";
}
public class LogAndConfig {
[JsonProperty(LangEN ? "Link to Discord webhook [FOR DETECTS]" : "Ссылка на вебхук Discord [ДЛЯ ДЕТЕКТОВ]")]
public string WebhookD {
get;
set;
}
= "1";
[JsonProperty(LangEN ? "Link to Discord webhook [FOR BANS]" : "Ссылка на вебхук Discord [ДЛЯ БАНОВ]")]
public string WebhookB {
get;
set;
}
= "1";
[JsonProperty(LangEN ? "Log detections in Discord?" : "Логировать детекты в Discord?")]
public bool isLog {
get;
set;
}
= true;
[JsonProperty(LangEN ? "Image in logging (standard version)" : "Картинка в логировании (версия стандартная)")]
public string WebhookImage {
get;
set;
}
= "https://media.giphy.com/media/V4pAZ7bxf1rOFoLCWS/giphy.gif";
}
public class RAConfig {
[JsonProperty(LangEN ? "Work with RustAPP?" : "Работать с RustAPP?")]
public bool isRustAPP {
get;
set;
}
= false;
[JsonProperty(LangEN ? "Log detections in RustAPP?" : "Логировать детекты в RustAPP?")]
public bool isRustAPPlog {
get;
set;
}
= false;
[JsonProperty(LangEN ? "IDs that cannot be reported 765000000000000, 76500000000000001" : "Айди, репорт на которых отправить нельзя 765000000000000, 76500000000000001")]
public List<string> idAntiReport {
get;
set;
}
= new List<string>();
[JsonProperty(LangEN ? "Automatically ban if the player received N reports?" : "Банить автоматически если игрок получил N кол-во репортов?")]
public bool isRustAPPbanAuto {
get;
set;
}
= false;
[JsonProperty(LangEN ? "Number of reports required for automatic ban?" : "Сколько репортов нужно получить для автоматического бана?")]
public int banAutoInt {
get;
set;
}
= 5;
[JsonProperty(LangEN ? "Punishment measure for max reports RustAPP (1 - Ban, 2 - Ban on all servers, 3 - On server by IP, 4 - on all servers by IP)" : "Мера наказания за макс.репортов RustAPP (1 - Бан, 2 - Бан на всех серверах, 3 - На сервере по IP, 4 - на всех серверах по IP")]
public int banMeraMR {
get;
set;
}
= 1;
[JsonProperty(LangEN ? "Ban only in RustAPP?" : "Банить только в RustAPP?")]
public bool isRustAPPbanOnly {
get;
set;
}
= false;
}
public class BMConfig {
[JsonProperty(LangEN ? "Work with BattleMetrics? [NOT WORK]" : "Работать с BattleMetrics? [НЕ РАБОТАЕТ]")]
public bool isBattleMetrics {
get;
set;
}
= false;
}
public class DBConfig {
[JsonProperty(LangEN ? "Work with the database of Cheaters? (records for half a year before 03/03/2024, main IDs from steam files and active accounts)" : "Работать с ДатаБазой читеров? (записи за пол года до 03.03.2024, основные айди из файлов стима и активные аккаунты)")]
public bool isDataBase {
get;
set;
}
= false;
[JsonProperty(LangEN ? "IDs to run on the server if they are in the database 765000000000000, 76500000000000001" : "Айди, которые запускать на сервер если они есть в базе 765000000000000, 76500000000000001")]
public List<string> idAntiKick {
get;
set;
}
= new List<string>();
[JsonProperty(LangEN ? "Enable checking in the invishack database? more than 800 entries obtained by hacking and an agreement with the cheat developer" : "Включить проверку в базе invishack? более 800 записей, полученые путем взлома и договором с разработчиком чита")]
public bool isInvishack {
get;
set;
}
= false;
[JsonProperty(LangEN ? "Enable checking in the amphetamine database? more than 400 records obtained through an agreement with the cheat developer" : "Включить проверку в базе amphetamine? более 400 записей, полученые путем договора с разработчиком чита")]
public bool isAmphetamine {
get;
set;
}
= false;
[JsonProperty(LangEN ? "Enable checking in GOPOTA (MR.BIG DICK) database? more than 5000 records obtained through an agreement with the developer" : "Включить проверку в GOPOTA (MR.BIG DICK)? более 5000 записей, полученые путем договора с разработчиком")]
public bool isGopota {
get;
set;
}
= false;
}
protected override void LoadConfig() {
base.LoadConfig();
try {
_config = Config.ReadObject<ConfigData>();
if (_config == null) LoadDefaultConfig();
}
catch {
Debug.LogError("[AntiCheatScience] CONFIGURATION ERROR, LOADING DEFAULT CONFIGURATION");
LoadDefaultConfig();
}
NextTick(SaveConfig);
}
[ConsoleCommand("acs_loadconfig")]
private void Command (ConsoleSystem.Arg arg) {
if (arg.Player() == null) {
Debug.LogWarning("[AntiCheatScience] The configuration reading process has started!");
LoadConfig();
}
}
protected override void LoadDefaultConfig() => _config = new ConfigData();
protected override void SaveConfig() => Config.WriteObject(_config, true);
#endregion Configuration
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("UGH, GARBAGE MAN, REMOVE THE LEAKED PLUGINS!!!");
Debug.LogError("REMOVE THE LEAKED PLUGINS");
Debug.LogError("REMOVE THE LEAKED PLUGINS");
Debug.LogError("REMOVE THE LEAKED PLUGINS");
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 || !_config.MeleeAttack.isMA) return null;
var hitPlayer = info.HitEntity as BasePlayer;
if (hitPlayer == null || BasePlayer.sleepingPlayerList.Contains(hitPlayer)) return null;
if (Mathf.Abs(player.transform.position.y - hitPlayer.transform.position.y) >= 1f) return null;
var parentEntity = player.GetParentEntity();
if (parentEntity is CargoShip || parentEntity is BaseBoat || 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 (FLuma != null) {
if ((bool)FLuma.CallHook("IsSteam", player.Connection)) return null;
}
if (FreePlayerFriendly != null) {
if ((bool)FreePlayerFriendly.CallHook("IsPlayerNoSteam", player.UserIDString)) 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.6f, 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, weaponM, startPos, maxRadius, hit, maxHitDistance, false);
if (MeleeDetect == 1) {
timer.Once(30f, () => MeleeDetect = 0);
}
if (MeleeDetect == 3) {
DetectNo10(player, MeleeDetect, weaponM, startPos, maxRadius, hit, maxHitDistance, true);
if (_config.MeleeAttack.isMeleeAttackBan) {
if (_config.RustAPP.isRustAPP) {
string command = $"ra.ban {player.userID.ToString()} \"{_config.MeleeAttack.NameMeleeAttack} [AntiCheatScience]\"";
switch (_config.MeleeAttack.banMeraMeleeAttack) {
case 2 : command += " --global";
break;
case 3 : command += " --ban-ip";
break;
case 4 : command += " --ban-ip --global";
break;
}
rust.RunServerCommand(command);
}
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) {
info.damageTypes.ScaleAll(0.01f);
}
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++;
}
}
}*/
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");
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]) {
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 (
// ... [Code preview truncated due to length. Full source in attached file] ...