change /ga
This commit is contained in:
@@ -82,15 +82,15 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
|
|
||||||
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
||||||
|
|
||||||
string rank = string.Empty;
|
string factionName = string.Empty;
|
||||||
|
|
||||||
if (f?.GangOwned == true)
|
if (f?.GangOwned == true)
|
||||||
{
|
{
|
||||||
rank = user.FactionRank.RankName;
|
factionName = user.Faction.Name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rank = "[ADMIN]";
|
factionName = "[ADMIN]";
|
||||||
}
|
}
|
||||||
|
|
||||||
var logEntry = new GangChatLogEntry()
|
var logEntry = new GangChatLogEntry()
|
||||||
@@ -102,7 +102,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
dbContext.GangChatLogs.Add(logEntry);
|
dbContext.GangChatLogs.Add(logEntry);
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
|
|
||||||
string broadcastMessage = "!{FF0000}** " + rank + " " + player.Name + ": " + message + " **";
|
string broadcastMessage = "!{CC3333}** [" + factionName + "] " + player.Name + ": " + message + " **";
|
||||||
using (var context = new DatabaseContext())
|
using (var context = new DatabaseContext())
|
||||||
{
|
{
|
||||||
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.GangOwned), true, (admin) => admin.HasData("togga"));
|
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.GangOwned), true, (admin) => admin.HasData("togga"));
|
||||||
|
|||||||
Reference in New Issue
Block a user