From 6da1820937e49eea441856906e37719e971fbd94 Mon Sep 17 00:00:00 2001 From: hydrant Date: Wed, 17 Oct 2018 11:58:28 +0200 Subject: [PATCH] Added /lc (Leader Chat) --- Server/Commands/Faction.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Server/Commands/Faction.cs b/Server/Commands/Faction.cs index aacce988..f1b84674 100644 --- a/Server/Commands/Faction.cs +++ b/Server/Commands/Faction.cs @@ -183,5 +183,21 @@ namespace reallife_gamemode.Server.Commands } } + [Command("lc", "~m~Benutzung: ~s~/lc [Nachricht]", GreedyArg = true)] + public void CmdFactionLc(Client player, string message) + { + if (player.GetUser()?.FactionId == null || player.GetUser().FactionLeader == false) + { + ChatService.NotAuthorized(player); + return; + } + + string broadcastMsg = "~y~[" + player.GetUser().GetFaction().Name + "] " + player.Name + ": " + message; + + NAPI.Pools.GetAllPlayers().ForEach(p => + { + if (p.GetUser()?.FactionLeader ?? false) p.SendChatMessage(broadcastMsg); + }); + } } }