Esempio n. 1
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            PlayerCommandSender playerCommandSender = sender as PlayerCommandSender;
            EPlayer             pplayer             = EPlayer.Get(((CommandSender)sender).SenderId);

            if (!CmdCooldown.Contains(pplayer))
            {
                if (sender is PlayerCommandSender ply && EPlayer.Get(ply.SenderId) is EPlayer pp && pp.Role == RoleType.Scp173)
                {
                    foreach (var effect in pp.ReferenceHub.playerEffectsController.AllEffects.Values
                             .Where(x => x.GetType() == typeof(Scp268) || x.GetType() == typeof(Amnesia)))
                    {
                        if (!effect.Enabled)
                        {
                            pp.ReferenceHub.playerEffectsController.EnableEffect(effect, 15f);
                        }
                        else
                        {
                            effect.ServerDisable();
                        }
                    }
                    pp.IsInvisible = !pp.IsInvisible;
                    pp.Broadcast(5, $"You are now {(pp.IsInvisible ? "invisible" : "visible")}!");
                    response = $"You are {(pp.IsInvisible ? "Invisible" : "Visible")} now";
                    if (pp.IsInvisible)
                    {
                        Timing.CallDelayed(15f, () =>
                        {
                            pp.IsInvisible = false;
                        });
                    }
                    foreach (EPlayer shitass in EPlayer.List)
                    {
                        if (shitass.ReferenceHub.playerEffectsController.GetEffect <Amnesia>().Enabled&& pp.Role == RoleType.Scp173)
                        {
                            Scp173.TurnedPlayers.Add(shitass);
                        }
                    }
                    Coroutine.Add(Timing.RunCoroutine(VentCooldown(Singleton.Config.VentCooldown, pp)));
                    CmdCooldown.Add(pp);
                    return(true);
                }
                else
                {
                    response = "You are not SCP-173";
                    return(false);
                }
            }