Esempio n. 1
0
        /// <summary>
        /// Handcuff a player by another player.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="target"></param>
        public static void HandcuffPlayer(this ReferenceHub player, ReferenceHub target)
        {
            Handcuffs handcuffs = target.handcuffs;

            if (handcuffs == null)
            {
                return;
            }

            if (handcuffs.CufferId < 0 && player.inventory.items.Any((Inventory.SyncItemInfo item) => item.id == ItemType.Disarmer) && Vector3.Distance(player.transform.position, target.transform.position) <= 130f)
            {
                handcuffs.NetworkCufferId = player.GetPlayerId();
            }
        }
Esempio n. 2
0
        public static bool Prefix(CheaterReport __instance, int playerId, string reason)
        {
            ReferenceHub reported = Player.GetPlayer(playerId);
            ReferenceHub reporter = Player.GetPlayer(__instance.gameObject);

            Log.Debug($"[ReportPatch] Reported:{reported.GetNickname()} Reason:{reason} Reporter:{reporter.GetNickname()}");

            if (!string.IsNullOrEmpty(Configs.report_webhook) &&
                !string.IsNullOrEmpty(reporter.GetUserId()) &&
                !string.IsNullOrEmpty(reported.GetUserId()) &&
                reported.GetPlayerId() != reporter.GetPlayerId())
            {
                Methods.SendReport(reported, reason, reporter);
                __instance.GetComponent <GameConsoleTransmission>().SendToClient(__instance.connectionToClient, "Player report successfully sent.", "green");
                return(false);
            }

            return(true);
        }