/lc und /ga für admins

This commit is contained in:
hydrant
2021-04-03 22:56:06 +02:00
parent a360d5e06e
commit 44aaea6021
2 changed files with 16 additions and 7 deletions

View File

@@ -52,11 +52,12 @@ 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)
public static void BroadcastFaction(string message, List<Faction> factions, bool toAdmins = false)
{
foreach (Player c in NAPI.Pools.GetAllPlayers())
{
Faction f = c.GetUser()?.Faction;
User user = c.GetUser();
Faction f = user.Faction;
if (f != null)
{
if (factions.Find(fT => fT.Id == f.Id) != null)
@@ -64,6 +65,10 @@ namespace ReallifeGamemode.Server.Services
ChatService.SendMessage(c, message);
}
}
else if(user.IsAdmin(AdminLevel.ADMIN) && toAdmins)
{
ChatService.SendMessage(c, message);
}
}
}