Added /lc (Leader Chat)

This commit is contained in:
hydrant
2018-10-17 11:58:28 +02:00
parent 162a3a4094
commit 8514c98a7f

View File

@@ -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);
});
}
} }
} }