diff --git a/Source Code/EventHandlers.cs b/Source Code/EventHandlers.cs index c392daf..68e4853 100644 --- a/Source Code/EventHandlers.cs +++ b/Source Code/EventHandlers.cs @@ -1,21 +1,8 @@ using System.Collections.Generic; -using System.ComponentModel; -using System.Globalization; -using Discord; -using Exiled.API.Enums; -using Exiled.API.Extensions; -using Exiled.API.Features; -using Exiled.API.Features.Roles; using Exiled.Events.EventArgs.Player; using Exiled.Events.EventArgs.Server; using MEC; using PlayerRoles; -using PlayerRoles.FirstPersonControl; -using PluginAPI.Core; -using PluginAPI.Roles; -using RemoteAdmin.Communication; -using YamlDotNet.Core; -using static Exiled.API.Enums.GeneratorState; using Player = Exiled.API.Features.Player; using Round = Exiled.API.Features.Round; using Server = Exiled.API.Features.Server; @@ -37,65 +24,37 @@ public void roundended(RoundEndedEventArgs ev) public IEnumerator cor() { - for (;;) + while (true) { { + Dictionary roleColorDict = new Dictionary() + { + {RoleTypeId.ClassD, "FF8E00"}, + {RoleTypeId.Scientist,"FFFF7C"}, + {RoleTypeId.FacilityGuard, "5B6370"}, + {RoleTypeId.NtfCaptain, "003ECA"}, + {RoleTypeId.NtfSergeant, "0096FF"}, + {RoleTypeId.NtfSpecialist, "0096FF"}, + {RoleTypeId.NtfPrivate, "6FC3FF"}, + {RoleTypeId.ChaosRepressor, "006728"}, + {RoleTypeId.ChaosMarauder, "006728"}, + {RoleTypeId.ChaosRifleman, "006728"}, + { RoleTypeId.ChaosConscript, "006728"} + }; string HintMessage = Plugin.Instance.Config.Hint.Replace("%tps%", Server.Tps.ToString()) .Replace("{MinPlayers}", Server.PlayerCount.ToString()) .Replace("{MaxPlayers}", Server.MaxPlayerCount.ToString()) .Replace("{Minutes}", Round.ElapsedTime.Minutes.ToString()) - .Replace("{Seconds}", Round.ElapsedTime.Seconds.ToString()).Replace("%NameServer%", Server.Name) + .Replace("{Seconds}", Round.ElapsedTime.Seconds.ToString()) + .Replace("%NameServer%", Server.Name) .Replace("{FF}", Server.FriendlyFire.ToString()) .Replace("{ServerName}", Server.Name) .Replace("{SCPs}", Round.SurvivingSCPs.ToString()) .Replace("{UserRole}", RoleTranslations.RoleNamesFile); - foreach (Player player in Player.List) - { - if (player.Role.Type == RoleTypeId.ClassD) - { - player.ShowHint($" {HintMessage}", 50); - } - if (player.Role.Type == RoleTypeId.Scientist) - { - player.ShowHint($" {HintMessage}", 50); - } - if (player.Role.Type == RoleTypeId.FacilityGuard) - { - player.ShowHint($" {HintMessage}", 50); - } - if (player.Role.Type == RoleTypeId.NtfCaptain) - { - player.ShowHint($" {HintMessage}", 50); - } - if (player.Role.Type == RoleTypeId.NtfSergeant) - { - player.ShowHint($" {HintMessage}", 50); - } - if (player.Role.Type == RoleTypeId.NtfSpecialist) - { - player.ShowHint($" {HintMessage}", 50); - } - if (player.Role.Type == RoleTypeId.NtfPrivate) - { - player.ShowHint($" {HintMessage}", 50); - } - if (player.Role.Type == RoleTypeId.ChaosRepressor) - { - player.ShowHint($" {HintMessage}", 50); - } - if (player.Role.Type == RoleTypeId.ChaosMarauder) - { - player.ShowHint($" {HintMessage}", 50); - } - if (player.Role.Type == RoleTypeId.ChaosRifleman) - { - player.ShowHint($" {HintMessage}", 50); - } - if (player.Role.Type == RoleTypeId.ChaosConscript) - { - player.ShowHint($" {HintMessage}", 50); - } + foreach (Player player in Player.List) { + player.ShowHint($" {HintMessage}", + 50); } } yield return Timing.WaitForSeconds(1f);