diff --git a/ReallifeGamemode.Server/Commands/FactionCommands.cs b/ReallifeGamemode.Server/Commands/FactionCommands.cs index fdabd88a..bac65955 100644 --- a/ReallifeGamemode.Server/Commands/FactionCommands.cs +++ b/ReallifeGamemode.Server/Commands/FactionCommands.cs @@ -55,7 +55,18 @@ namespace ReallifeGamemode.Server.Commands { message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", ""); - string broadcastMessage = "!{FF0000}** " + player.GetUser().GetFactionRank().RankName + " " + player.Name + ": " + message + " **"; + string rank = string.Empty; + + if(f.Name == "Ballas" || f.Name == "Grove") + { + rank = player.GetUser().GetFactionRank().RankName; + } + else + { + rank = "[ADMIN]"; + } + + string broadcastMessage = "!{FF0000}** " + rank + " " + player.Name + ": " + message + " **"; using (var context = new DatabaseContext()) { ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.GangOwned), true); @@ -188,12 +199,25 @@ namespace ReallifeGamemode.Server.Commands message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", ""); - string broadcastMsg = "~y~[" + player.GetUser().Faction.Name + "] " + player.Name + ": " + message; + string factionName = string.Empty; + if(user.FactionLeader) + { + factionName = player.GetUser().Faction.Name; + } + else + { + factionName = "ADMIN"; + } + + string broadcastMsg = "~y~[" + factionName + "] " + player.Name + ": " + message; NAPI.Pools.GetAllPlayers().ForEach(p => { User pUser = p.GetUser(); - if (pUser?.FactionLeader ?? false || pUser.IsAdmin(AdminLevel.ADMIN)) ChatService.SendMessage(p, broadcastMsg); + if (pUser.FactionLeader || pUser.IsAdmin(AdminLevel.ADMIN)) + { + ChatService.SendMessage(p, broadcastMsg); + } }); } diff --git a/ReallifeGamemode.Server/Services/ChatService.cs b/ReallifeGamemode.Server/Services/ChatService.cs index 777ad884..692c4263 100644 --- a/ReallifeGamemode.Server/Services/ChatService.cs +++ b/ReallifeGamemode.Server/Services/ChatService.cs @@ -58,12 +58,9 @@ namespace ReallifeGamemode.Server.Services { User user = c.GetUser(); Faction f = user?.Faction; - if (f != null) + if (f != null && factions.Find(fT => fT.Id == f.Id) != null) { - if (factions.Find(fT => fT.Id == f.Id) != null) - { - ChatService.SendMessage(c, message); - } + ChatService.SendMessage(c, message); } else if (user.IsAdmin(AdminLevel.ADMIN) && toAdmins) {