diff --git a/CS2AnnouncementBroadcaster.cs b/CS2AnnouncementBroadcaster.cs index 674418d..885834f 100644 --- a/CS2AnnouncementBroadcaster.cs +++ b/CS2AnnouncementBroadcaster.cs @@ -12,7 +12,7 @@ public class CS2AnnouncementBroadcaster : BasePlugin { public override string ModuleName => "CS2 Announcement Broadcaster"; - public override string ModuleVersion => "0.2.0"; + public override string ModuleVersion => "0.2.1"; public override string ModuleAuthor => "Lengran"; @@ -131,19 +131,24 @@ public HookResult OnPlayerConnectFull(EventPlayerConnectFull @event, GameEventIn [GameEventHandler] public HookResult OnRoundStart(EventRoundStart @event, GameEventInfo info) { - var players = Utilities.GetPlayers(); - - foreach (var tmpPlayer in players) + // var players = Utilities.GetPlayers(); + + // foreach (var tmpPlayer in players) + // { + // if (!tmpPlayer.IsValid || tmpPlayer.IsBot || tmpPlayer.IsHLTV) + // { + // continue; + // } + + // foreach (var msg in _onRoundStartMsgs) + // { + // tmpPlayer.PrintToChat(msg.msg); + // } + // } + + foreach (var msg in _onRoundStartMsgs) { - if (!tmpPlayer.IsValid || tmpPlayer.IsBot || tmpPlayer.IsHLTV) - { - continue; - } - - foreach (var msg in _onRoundStartMsgs) - { - tmpPlayer.PrintToChat(msg.msg); - } + Server.PrintToChatAll(msg.msg); } return HookResult.Continue; @@ -199,17 +204,18 @@ private void UnregisterCommand() private void RegisterTimer(TimerMsg msg) { var timer = AddTimer(msg.timer, () => { - var players = Utilities.GetPlayers(); - - foreach (var tmpPlayer in players) - { - if (!tmpPlayer.IsValid || tmpPlayer.IsBot || tmpPlayer.IsHLTV) - { - continue; - } - - tmpPlayer.PrintToChat(msg.msg); - } + // var players = Utilities.GetPlayers(); + + // foreach (var tmpPlayer in players) + // { + // if (!tmpPlayer.IsValid || tmpPlayer.IsBot || tmpPlayer.IsHLTV) + // { + // continue; + // } + + // tmpPlayer.PrintToChat(msg.msg); + // } + Server.PrintToChatAll(msg.msg); }, CounterStrikeSharp.API.Modules.Timers.TimerFlags.REPEAT); _registeredTimers.Add(timer);