Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Essentials/Patches/ChatMessagePatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,16 @@ public static void Patch(PatchContext ctx) {
}

private static bool OnChatMessageReceived_Server(ref ChatMsg msg) {
var Account = PlayerAccountData.GetAccount(msg.Author);
if (Account != null) {
var Rank = RanksAndPermissions.GetRankData(Account.Rank);
if (Rank.DisplayPrefix) {
msg.Author = 0;
msg.CustomAuthorName = $"{Rank.Prefix}{Account.Player}";
if (EssentialsPlugin.Instance.Config.EnableRanks) {
var Account = PlayerAccountData.GetAccount(msg.Author);
if (Account != null) {
var Rank = RanksAndPermissions.GetRankData(Account.Rank);
if (Rank.DisplayPrefix) {
msg.Author = 0;
msg.CustomAuthorName = $"{Rank.Prefix}{Account.Player}";
}
}
return true;
}
return true;
}
Expand Down