/tog d & ga

This commit is contained in:
hydrant
2021-04-20 23:41:22 +02:00
parent e3a9b0d7e5
commit d12f10fbb4
3 changed files with 29 additions and 6 deletions

View File

@@ -53,7 +53,7 @@ namespace ReallifeGamemode.Server.Services
/// </summary>
/// <param name="message">Die Nachricht, die gesendet werden soll</param>
/// <param name="factions">Die Liste an Fraktionen, die diese Nachricht bekommen sollen</param>
public static void BroadcastFaction(string message, List<Faction> factions, bool toAdmins = false)
public static void BroadcastFaction(string message, List<Faction> factions, bool toAdmins = false, Predicate<Player> shouldSendToAdmins = null)
{
foreach (Player c in NAPI.Pools.GetAllPlayers())
{
@@ -63,7 +63,7 @@ namespace ReallifeGamemode.Server.Services
{
ChatService.SendMessage(c, message);
}
else if (user.IsAdmin(AdminLevel.ADMIN) && toAdmins)
else if (user.IsAdmin(AdminLevel.ADMIN) && (toAdmins && (shouldSendToAdmins == null || shouldSendToAdmins(c))))
{
ChatService.SendMessage(c, message);
}