Ejemplo n.º 1
0
        private IEnumerator <float> BOut()
        {
            Cassie.Message(Plugin.plugin.Config.BlackoutCassie);
            yield return(Timing.WaitForSeconds(13f));

            Map.TurnOffAllLights(Plugin.plugin.Config.BlackoutTime);
        }
Ejemplo n.º 2
0
        public static void MakeNobody(Player nobody, Vector3 spawn_pos)
        {
            nobody.Role      = RoleType.Tutorial;
            nobody.MaxHealth = Plugin.Instance.Config.NobodyHealth;
            nobody.Health    = nobody.MaxHealth;
            foreach (ItemType item in Plugin.Instance.Config.NobodyStartItems)
            {
                nobody.AddItem(item);
            }
            nobody.Ammo[(int)AmmoType.Nato556] = Plugin.Instance.Config.Nobody5Ammo;
            nobody.Ammo[(int)AmmoType.Nato762] = Plugin.Instance.Config.Nobody7Ammo;
            nobody.Ammo[(int)AmmoType.Nato9]   = Plugin.Instance.Config.Nobody9Ammo;

            Timing.CallDelayed(0.5f, () =>
            {
                nobody.ReferenceHub.playerMovementSync.AddSafeTime(1.0f);
                nobody.Position = spawn_pos + new Vector3(0, 0.75f, 0);
            });

            nobody.Broadcast(5, Plugin.Instance.Config.NobodyPrivateBroadcast);
            if (Plugin.Instance.Config.NobodyCmdMessage.Length != 0)
            {
                nobody.SendConsoleMessage(Plugin.Instance.Config.NobodyCmdMessage, "yellow");
            }
            Map.Broadcast(5, Plugin.Instance.Config.NobodyGlobalBroadcast);

            if (Plugin.Instance.Config.NobodyCassieAnnouncement.Length != 0)
            {
                Cassie.Message(Plugin.Instance.Config.NobodyCassieAnnouncement, false, false);
            }
        }
Ejemplo n.º 3
0
        public void HCZDecont()
        {
            HCZDecontOnline = true;

            Cassie.Message("P B 3 Protocol has been activated . activating heavy zone decontamination . 4 minutes remaining", false, false);

            LCZDecontWasActivated = true;

            Cassie.DelayedMessage("attention . 3 minutes remaining to heavy zone decontamination . allremaining", 60f, false, false);

            Cassie.DelayedMessage("attention . 2 minutes remaining to heavy zone decontamination . allremaining", 120f, false, false);

            Cassie.DelayedMessage("attention . 1 minute remaining to heavy zone decontamination . entrance zone checkpoint has been opend . allremaining", 180f, false, false);

            Timing.CallDelayed(180f, () =>
            {
                CheckpointEZ.SetStateWithSound(true);
                CheckpointEZ.Networklocked = true;
            });

            Cassie.DelayedMessage("attention . light zone decontamination started . entrance zone checkpoint has been closed . allremaining", 240f, false, false);

            Timing.CallDelayed(240f, () =>
            {
                CheckpointEZ.SetStateWithSound(false);
                HCZDecontOnline = false;
            });
        }
Ejemplo n.º 4
0
        public void LCZDecont()
        {
            LCZDecontOnline = true;
            Cassie.Message("P B 2 Protocol has been activated . activating light zone decontamination . 4 minutes remaining", false, false);

            LCZDecontWasActivated = true;

            Cassie.DelayedMessage("attention . 3 minutes remaining to light zone decontamination . allremaining", 60f, false, false);

            Cassie.DelayedMessage("attention . 2 minutes remaining to light zone decontamination . allremaining", 120f, false, false);

            Cassie.DelayedMessage("attention . 1 minute remaining to light zone decontamination . checkpoints a and b have been opend . allremaining", 180f, false, false);

            Timing.CallDelayed(180f, () =>
            {
                CheckpointA.SetStateWithSound(true);
                CheckpointB.SetStateWithSound(true);
                CheckpointA.Networklocked = true;
                CheckpointB.Networklocked = true;
            });

            Cassie.DelayedMessage("attention . light zone decontamination started . all checkpoints have been closed . allremaining", 240f, false, false);

            Timing.CallDelayed(240f, () =>
            {
                CheckpointA.SetStateWithSound(false);
                CheckpointB.SetStateWithSound(false);
                LCZDecontOnline = false;
            });
        }
Ejemplo n.º 5
0
        public void BlockCheckpointsAndGates()
        {
            Cassie.Message("P L 2 Protocol has been activated . all gates and checkpoints have been lockdown for 2 minutes", false, false);

            GateA.SetStateWithSound(false);
            GateB.SetStateWithSound(false);
            GateA.Networklocked = true;
            GateB.Networklocked = true;

            if (!LCZDecontWasActivated)
            {
                CheckpointA.SetStateWithSound(false);
                CheckpointB.SetStateWithSound(false);
                CheckpointA.Networklocked = true;
                CheckpointB.Networklocked = true;
            }
            else
            {
                Cassie.Message("attention . checkpoints a and b can not be locked cause of light containment zone decontamination", false, false);
            }

            if (!HCZDecontWasActivated)
            {
                CheckpointEZ.SetStateWithSound(false);
                CheckpointEZ.Networklocked = true;
            }
            else
            {
                Cassie.Message("attention . entrance zone checkpoint can not be locked cause of heavy containment zone decontamination", false, false);
            }

            Timing.CallDelayed(120f, UnBlockCheckpoints);
            Timing.CallDelayed(120f, UnBlockGates);
        }
Ejemplo n.º 6
0
        public void CheckForEvent(string EventName, bool HasPlayerParam, bool HasExtraParam, Player player = null, DamageTypes.DamageType cause = null, int NumberOfRespawns = 0, string killerName = null, Respawning.SpawnableTeamType spawnableTeam = Respawning.SpawnableTeamType.None, string reason = null)
        {
            var config = CommsHackEvents.Instance.Config;

            if (eventsS.ContainsKey(EventName))
            {
                AudioAPI.API.PlayFile(eventsS[EventName], CommsHackEvents.Instance.Config.Volume);
            }
            if (eventsBc.ContainsKey(EventName))
            {
                if (HasPlayerParam)
                {
                    if (HasExtraParam)
                    {
                        Map.Broadcast(config.Duration, FilterString(eventsBc[EventName], player, cause, NumberOfRespawns, killerName, spawnableTeam, reason));
                    }
                    Map.Broadcast(config.Duration, FilterString(eventsBc[EventName], player));
                }
            }
            if (eventsC.ContainsKey(EventName))
            {
                if (HasExtraParam)
                {
                    Cassie.Message(FilterString(eventsC[EventName], player, cause, NumberOfRespawns, killerName, spawnableTeam, reason));
                }
                Cassie.Message(FilterString(eventsC[EventName], player));
            }
            if (eventsF.ContainsKey(EventName))
            {
                Map.Broadcast(5, "Please contact a server admin: CommsHackEvents functions is not supported yet.");
            }
        }
Ejemplo n.º 7
0
 public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
 {
     if (!((CommandSender)sender).CheckPermission("CassiePlugin.cassie"))
     {
         response = "You do not have permission to use this command";
         return(false);
     }
     if (arguments.Count != 2)
     {
         response = "Usage: cbc (plurality 0-1) (zone 1-4)";
         return(false);
     }
     if (!(arguments.At(0).Equals("0")) && !(arguments.At(0).Equals("1")))
     {
         response = "Usage: cbc (plurality 0-1) (zone 1-4)";
         return(false);
     }
     if (!(arguments.At(1).Equals("1")) && !(arguments.At(1).Equals("2")) && !(arguments.At(1).Equals("3")) && !(arguments.At(1).Equals("4")))
     {
         response = "Usage: cbc (plurality 0-1) (zone 1-4)";
         return(false);
     }
     Cassie.Message("ATTENTION . LAST TARGET" + getPlural(arguments.At(0)) + " " + getZone(arguments.At(1)));
     response = "Cassie broadcast sent. ";
     return(true);
 }
Ejemplo n.º 8
0
 public void OnSpawning(SpawningEventArgs ev)
 {
     if (Tracking.PlayersInvisibleByCommand.Contains(ev.Player))
     {
         Tracking.PlayersInvisibleByCommand.Remove(ev.Player);
     }
     Timing.CallDelayed(Subclass.Instance.CommonUtilsEnabled ? 2f : 0.1f, () =>
     {
         Tracking.QueuedCassieMessages.Clear();
         if (Tracking.NextSpawnWave.Contains(ev.Player) && Tracking.NextSpawnWaveGetsRole.ContainsKey(ev.Player.Role))
         {
             Tracking.RemoveAndAddRoles(ev.Player, true);
             Tracking.AddClass(ev.Player, Tracking.NextSpawnWaveGetsRole[ev.Player.Role]);
         }
         else
         {
             if (!Tracking.PlayersWithSubclasses.ContainsKey(ev.Player))
             {
                 Tracking.RemoveAndAddRoles(ev.Player, false, Subclass.Instance.Scp035Enabled && scp035.API.Scp035Data.GetScp035()?.Id == ev.Player.Id);
             }
         }
         foreach (string message in Tracking.QueuedCassieMessages)
         {
             Cassie.Message(message, true, false);
             Log.Debug($"Sending message via cassie: {message}", Subclass.Instance.Config.Debug);
         }
         Tracking.CheckRoundEnd();
     });
 }
Ejemplo n.º 9
0
        private IEnumerator <float> RunUltimate()
        {
            Cassie.Message(
                "warning . malfunction detected on heavy containment zone . Scp079Recon6 . . . light systems Disengaged");
            yield return(Timing.WaitForSeconds(12.1f));

            Map.TurnOffAllLights(Pro079Blackout.Singleton.Config.BlackoutDuration);
        }
Ejemplo n.º 10
0
        internal static void SpawnSquad(List <Player> players)
        {
            foreach (Player player in players)
            {
                SpawnPlayer(player);
            }

            Cassie.Message(SerpentsHand.instance.Config.EntryAnnouncement, true, true);
        }
Ejemplo n.º 11
0
        public void OnRACommand(SendingRemoteAdminCommandEventArgs ev)
        {
            if (ev.Name == "pos")
            {
                ev.Sender.RemoteAdminMessage(ev.Sender.Position.ToString(), true);
            }
            string cmd = ev.Name.ToLower();

            if (cmd == "spawnsh")
            {
                ev.IsAllowed = false;

                if (ev.Arguments.Count > 0 && ev.Arguments[0].Length > 0)
                {
                    Player cPlayer = Player.Get(ev.Arguments[0]);
                    if (cPlayer != null)
                    {
                        SpawnPlayer(cPlayer);
                        ev.Sender.RemoteAdminMessage($"Spawned {cPlayer.Nickname} as Serpents Hand.", true);
                        return;
                    }
                    else
                    {
                        ev.Sender.RemoteAdminMessage("Invalid player.", false);
                        return;
                    }
                }
                else
                {
                    ev.Sender.RemoteAdminMessage("SPAWNSH [Player Name / Player ID]", false);
                }
            }
            else if (cmd == "spawnshsquad")
            {
                ev.IsAllowed = false;

                if (ev.Arguments.Count > 0)
                {
                    if (int.TryParse(ev.Arguments[0], out int a))
                    {
                        CreateSquad(a);
                    }
                    else
                    {
                        ev.Sender.RemoteAdminMessage("Error: invalid size.", false);
                        return;
                    }
                }
                else
                {
                    CreateSquad(5);
                }
                Cassie.Message(SerpentsHand.instance.Config.EntryAnnouncement, true, true);
                ev.Sender.RemoteAdminMessage("Spawned squad.", true);
            }
        }
Ejemplo n.º 12
0
 public void OnRoundEnd(RoundEndedEventArgs ev)
 {
     Map.Broadcast(20, $"<size=50><color=blue>라운드</color>가 종료되었습니다.\n다음 라운드 시작까지 : {ev.TimeToRestart}초</size>");
     Cassie.Message($"Xmas_JingleBells");
     Map.TurnOffAllLights(20.0f, false);
     foreach (CoroutineHandle coroutine in plugin.Coroutines)
     {
         Timing.KillCoroutines(coroutine);
     }
 }
Ejemplo n.º 13
0
 public void BlockAllDoors()
 {
     Cassie.Message("P L 3 Protocol has been activated . all doors have been lockdown for 45 seconds", false, false);
     foreach (Door door in allDoors)
     {
         door.SetStateWithSound(false);
         door.Networklocked = true;
     }
     Timing.CallDelayed(45f, UnBlockAllDoors);
 }
Ejemplo n.º 14
0
 public void OnGeneratorActive(ActivatingGeneratorEventArgs ev)
 {
     ev.Generator.Engaged = true;
     if (Recontainer079.AllGenerators.All(x => x.Engaged))
     {
         Cassie.Message(".g6 Armory And Entrance Zone Reactivation Sequence Engaged . Weapons Are Now Available", true, false);
         escapeReady = true;
     }
     Map.Broadcast(5, $"<i>Generator {GetGeneratorName(ev.Generator)} activated</i>");
 }
Ejemplo n.º 15
0
        private static IEnumerator <float> SendCassie(CassieAnnouncement cassie)
        {
            yield return(Timing.WaitForSeconds(cassie.Delay));

            var ev = new SendingCassieAnnouncementEventArgs(cassie.Content, cassie.Delay);

            if (ev.IsAllowed)
            {
                Cassie.Message(cassie.Content, false, false);
            }
        }
Ejemplo n.º 16
0
        public void Blackout(float duration, bool silent = false)
        {
            if (!silent)
            {
                Cassie.Message("P S 5 Protocol has been activated . all lights have been Disabled for 30 seconds", false, false);
            }
            Map.TurnOffAllLights(duration);

            TeslaDeactivated = true;
            Timing.CallDelayed(duration, () => TeslaDeactivated = false);
        }
Ejemplo n.º 17
0
 public void OnPlayerDied(DiedEventArgs ev)
 {
     if (ev.Target.Role == RoleType.Scp049 || ev.Target.Role == RoleType.Scp0492)
     {
         if (SCP008Check())
         {
             Log.Debug($"SCP008Check() passed. Announcing recontainment...", SCP008X.Instance.Config.DebugMode);
             Cassie.Message($"SCP 0 0 8 containedsuccessfully . noscpsleft", false, true);
         }
     }
 }
Ejemplo n.º 18
0
        /*
         * internal void OnClientCommand(SendingConsoleCommandEventArgs ev)
         * {
         *  switch (ev.Name.ToLower())
         *  {
         *      case "079":
         *          ArraySegment<string> args = new ArraySegment<string>(ev.Arguments.ToArray());
         *          BetterCommand.Instance.Execute(args, ev.Player.Sender, out string response);
         *          ev.Player.SendConsoleMessage(response, "yellow");
         *          break;
         *      case "secsys":
         *          break;
         *  }
         * }
         */
        public IEnumerator <float> Nuke()
        {
            Warhead.IsLocked = false;
            Warhead.Stop();
            Cassie.Message(PluginMain.Instance.Config.CanceledCassie);
            IsNukeOnCooldown = true;

            yield return(Timing.WaitForSeconds(PluginMain.Instance.Config.CancelCooldown));

            IsNukeOnCooldown = false;
        }
Ejemplo n.º 19
0
        private static void RunCassie(ScriptActionsStore dataObj)
        {
            foreach (var cassieData in dataObj.cassie)
            {
                Cassie.Message(cassieData.message, false, false);

                if (cassieData.role.roleID == "all")
                {
                    dataObj.cassie.Remove(cassieData);
                }
            }
        }
Ejemplo n.º 20
0
        private void DoBlackout(Player player)
        {
            Cassie.Message("pitch_0.15 .g7");
            foreach (var room in Map.Rooms)
            {
                if (room.Zone != ZoneType.Surface)
                {
                    room.TurnOffLights(Duration);
                }
            }

            _coroutines.Add(Timing.RunCoroutine(Keter(player, Duration)));
        }
Ejemplo n.º 21
0
        private IEnumerator <float> StartSystem()
        {
            while (isRoundStarted)
            {
                yield return(Timing.WaitForSeconds(UnityEngine.Random.Range(480, 660)));

                if (UnityEngine.Random.Range(0, 100) < 50)
                {
                    DoorVariant scp106door  = DoorNametagExtension.NamedDoors["106_PRIMARY"].TargetDoor;
                    DoorVariant scp106door2 = DoorNametagExtension.NamedDoors["106_SECONDARY"].TargetDoor;
                    foreach (DoorVariant door in Map.Doors.Where(x => x.transform.position != scp106door.transform.position && x.transform.position != scp106door2.transform.position))
                    {
                        doors.Add(door);
                    }

                    if (!Warhead.IsInProgress && !Warhead.IsDetonated)
                    {
                        isRestarting = true;
                        Timing.CallDelayed(delay, () => isRestarting = false);
                        Cassie.Message("CRITICAL ERROR . . DOOR SYSTEM MALFUNCTION IN PROGRESS . . DOOR SYSTEM SOFTWARE REPAIR COMMENCING IN 3 . 2 . 1 . . . . . . . DOOR SYSTEM REPAIR COMPLETE", true, true);
                        List <DoorVariant> openDoors = new List <DoorVariant>();
                        foreach (DoorVariant door in Map.Doors)
                        {
                            if (door.IsConsideredOpen())
                            {
                                openDoors.Add(door);
                            }
                        }
                        while (isRestarting)
                        {
                            DoorVariant door = doors[UnityEngine.Random.Range(0, doors.Count)];
                            Timing.RunCoroutine(BreakDoor(door));
                            yield return(Timing.WaitForSeconds(0.05f));
                        }
                        foreach (DoorVariant door in Map.Doors)
                        {
                            door.NetworkTargetState = false;
                            door.ServerChangeLock(DoorLockReason.AdminCommand, true);
                        }
                        yield return(Timing.WaitForSeconds(3f));

                        foreach (DoorVariant door in Map.Doors)
                        {
                            door.NetworkTargetState = openDoors.Contains(door);
                            door.ServerChangeLock(DoorLockReason.AdminCommand, false);
                        }
                        brokenDoors.Clear();
                    }
                }
            }
        }
Ejemplo n.º 22
0
        protected override bool ExecuteParent(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            EventHandlers.LogCommandUsed((CommandSender)sender, EventHandlers.FormatArguments(arguments, 0));
            if (!((CommandSender)sender).CheckPermission("at.ball"))
            {
                response = "You do not have permission to use this command";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "Usage: ball ((player id/ name) or (all / *))";
                return(false);
            }

            switch (arguments.At(0))
            {
            case "*":
            case "all":
                foreach (Player Pl in Player.List)
                {
                    if (Pl.Role == RoleType.Spectator || Pl.Role == RoleType.None)
                    {
                        continue;
                    }

                    EventHandlers.SpawnBallOnPlayer(Pl);
                }
                Cassie.Message("pitch_1.5 xmas_bouncyballs", true, false);
                response = "The Balls started bouncing";
                return(true);

            default:
                Player Ply = Player.Get(arguments.At(0));
                if (Ply == null)
                {
                    response = $"Player not found: {arguments.At(0)}";
                    return(false);
                }

                if (Ply.Role == RoleType.Spectator || Ply.Role == RoleType.None)
                {
                    response = $"You cannot spawn a ball on that player right now";
                    return(false);
                }

                EventHandlers.SpawnBallOnPlayer(Ply);
                response = $"The Balls started bouncing for {Ply.Nickname}";
                return(true);
            }
        }
Ejemplo n.º 23
0
        public void MTFSpawnAnnounce(AnnouncingNtfEntranceEventArgs ev)
        {
            if (chosenTeam != null)
            {
                ev.IsAllowed = false;
                if (chosenTeam.CassieMessageMTFSpawn != null)
                {
                    Cassie.Message(chosenTeam.CassieMessageMTFSpawn.Replace("{SCP}", ev.ScpsLeft.ToString()).Replace("{unit}", ev.UnitNumber.ToString()).Replace("{nato}", "nato_" + ev.UnitName[0].ToString()), isNoisy: false);
                }

                MainPlugin.Singleton.Classes.RenameUnit(respawns, chosenTeam.Name.ToUpper() + "-" + ev.UnitNumber.ToString());
                Map.ChangeUnitColor(respawns, chosenTeam.Color);
            }
        }
Ejemplo n.º 24
0
        public void OnRoundEnd(RoundEndedEventArgs ev)
        {
            Map.Broadcast(5, Plugin.Instance.Config.RoundEndmessage);

            if (Plugin.Instance.Config.AllLightoff == true)
            {
                Map.TurnOffAllLights(20, false);
            }

            if (Plugin.Instance.Config.cassieStart == true)
            {
                Cassie.Message(Plugin.Instance.Config.cassieword, false, false);
            }
        }
Ejemplo n.º 25
0
        private IEnumerator <float> Check079(float delay = 1f)
        {
            if (Map.ActivatedGenerators != 5 && canChange)
            {
                yield return(Timing.WaitForSeconds(delay));

                IEnumerable <Player> enumerable = Player.List.Where(x => x.Team == Team.SCP);
                if (!Lone079p.instance.Config.CountZombies)
                {
                    enumerable = enumerable.Where(x => x.Role != RoleType.Scp0492);
                }
                List <Player> pList = enumerable.ToList();

                if (pList.Count == 1 && pList[0].Role == RoleType.Scp079)
                {
                    Player player = pList[0];
                    int    level  = player.Level + 1;

                    Dictionary <RoleType, int> percentages = Lone079p.instance.Config.HealthPercentages[level];

                    RoleType role = RoleType.Scp173;

                    int rand = UnityEngine.Random.Range(0, 101);
                    int last = 0;
                    int sum  = 0;
                    foreach (var item in percentages)
                    {
                        last = sum;
                        sum += item.Value;
                        if (rand > last && rand <= sum)
                        {
                            role = item.Key;
                        }
                    }

                    if (is106Contained && role == RoleType.Scp106)
                    {
                        role = RoleType.Scp93953;
                    }
                    player.SetRole(role);
                    Timing.CallDelayed(1f, () => player.Position = scp939pos);

                    player.Health = player.MaxHealth * Lone079p.instance.Config.PercentHealth / 100f;

                    player.Broadcast(10, $"<i>You have been respawned as a random SCP with {Lone079p.instance.Config.PercentHealth}% health because all other SCPs have died.</i>");
                    Cassie.Message(Lone079p.instance.Config.ReplacementAnnouncement.Replace("%scp", role.ToString().Substring(0, 6).Insert(3, " ").Insert(5, " ").Insert(7, " ")));
                }
            }
        }
Ejemplo n.º 26
0
        private IEnumerator <float> RunUltimate()
        {
            NineTailedFoxAnnouncer.singleton.ServerOnlyAddGlitchyPhrase(
                "Security Lockdown pitch_2 scp 0 7 9 . Override pitch_1 Detected . . Automatic Emergency Zone lockdown Initializing . 3 . 2 . 1",
                10, 20);
            yield return(Timing.WaitForSeconds(10f));

            Pro079Lockdown.Singleton.IsActive = true;
            for (int i = 0; i < Application.targetFrameRate * Pro079Lockdown.Singleton.Config.LockdownDuration; i++)
            {
                yield return(0f);
            }

            Pro079Lockdown.Singleton.IsActive = false;
            Cassie.Message("Automatic Emergency zone lockdown . Disabled");
        }
Ejemplo n.º 27
0
        public void BlockGates()
        {
            Log.Info("woah1");
            Cassie.Message("P L 1 Protocol has been activated . all gates have been lockdown for 2 minutes", false, false);
            Log.Info("woah2");
            Log.Info(GateA == null);
            GateA.SetStateWithSound(false);
            Log.Info("woah3");
            GateB.SetStateWithSound(false);
            Log.Info("woah4");
            GateA.Networklocked = true;
            Log.Info("woah5");
            GateB.Networklocked = true;
            Log.Info("woah6");

            Timing.CallDelayed(120f, UnBlockGates);
        }
        private static void TriggerCassieZoneMessage(ZoneType zone)
        {
            switch (zone)
            {
            case ZoneType.Entrance:
                Cassie.Message("POWER OUTAGE IN ENTRANCE ZONE");
                break;

            case ZoneType.HeavyContainment:
                Cassie.Message("POWER OUTAGE IN HEAVY CONTAINMENT ZONE");
                break;

            case ZoneType.LightContainment:
                Cassie.Message("POWER OUTAGE IN LIGHT CONTAINMENT ZONE");
                break;
            }
        }
Ejemplo n.º 29
0
 public void OnRoundStarted()
 {
     Tracking.RoundStartedAt = Time.time;
     Timing.CallDelayed(Subclass.Instance.CommonUtilsEnabled ? 2f : 0.1f, () =>
     {
         Log.Debug("Round started", Subclass.Instance.Config.Debug);
         foreach (EPlayer player in EPlayer.List)
         {
             MaybeAddRoles(player);
         }
         foreach (string message in Tracking.QueuedCassieMessages)
         {
             Cassie.Message(message, true, false);
             Log.Debug($"Sending message via cassie: {message}", Subclass.Instance.Config.Debug);
         }
         Tracking.QueuedCassieMessages.Clear();
     });
 }
Ejemplo n.º 30
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (sender is PlayerCommandSender senderPlayer)
            {
                var player = Player.Get(senderPlayer.PlayerId);
                if ((Plugin.Instance.Config.AllowedRoles.Contains(player.RankName) ||
                     Plugin.Instance.Config.RaRoleBypass) && player.RemoteAdminAccess)
                {
                    if (!arguments.IsEmpty())
                    {
                        if (Plugin.Instance.Config.CassieBroadcast != "")
                        {
                            Map.Broadcast(Plugin.Instance.Config.BcTime, Plugin.Instance.Config.UseRoleColorForPrefixColor ?
                                          $"<color={player.RankColor}>{Plugin.Instance.Config.CassieBroadcast.Replace("%rank%", $"{player.RankName}")}</color>" :
                                          $"<color={Plugin.Instance.Config.BcPrefixColor}>{Plugin.Instance.Config.CassieBroadcast.Replace("%rank%", $"{player.RankName}")}</color>");
                        }
                        var args = "";
                        for (var i = 0; i < arguments.Count; i++)
                        {
                            args = $"{args} {arguments.At(i)}";
                        }
                        Cassie.Message(args);

                        response = args;
                        return(true);
                    }
                    else
                    {
                        response = Plugin.Instance.Config.NoArgs;
                        return(false);
                    }
                }
                else
                {
                    response = "Not permitted";
                    return(false);
                }
            }
            else
            {
                response = "Only for players";
                return(false);
            }
        }