Failed to compile NoGreen.cs - No overload for method 'PrintColoured' takes 4 arguments (L: 18 | P: 22) | Removing from project
Got this error in compiler log as of October 2025 update - won't load
I received the same error message and the plugin fails to load
I pasted the fixed cs, till the dev fix the one on uMod
using System; using CompanionServer; using ConVar; using Facepunch; using Facepunch.Math; using UnityEngine; namespace Oxide.Plugins { [Info("No Green", "Iv Misticos", "1.3.10")] [Description("Remove admins' green names")] class NoGreen : RustPlugin { private bool OnPlayerChat(BasePlayer player, string message, Chat.ChatChannel channel) { if (Chat.serverlog) { // β Fixed: replaced unsupported PrintColoured with Puts() Puts($"[{channel}] {player.displayName}: {message}"); var str = (player != null ? player.ToString() : null) ?? $"{player.displayName}[{player.userID}]"; if (channel == Chat.ChatChannel.Team) { DebugEx.Log("[TEAM CHAT] " + str + " : " + message); } else { DebugEx.Log("[CHAT] " + str + " : " + message); } } var color = "#5af"; var displayName = player.displayName.EscapeRichText(); var chatEntry = new Chat.ChatEntry { Channel = channel, Message = message, UserId = player.UserIDString, Username = displayName, Color = color, Time = Epoch.Current }; RCon.Broadcast(RCon.LogType.Chat, chatEntry); if (channel != Chat.ChatChannel.Global) { if (channel == Chat.ChatChannel.Team) { var playerTeam = RelationshipManager.ServerInstance.FindPlayersTeam(player.userID); if (playerTeam == null) { return false; } var onlineMemberConnections = playerTeam.GetOnlineMemberConnections(); if (onlineMemberConnections != null) { ConsoleNetwork.SendClientCommand(onlineMemberConnections, "chat.add2", 1, player.userID, message, displayName, color, 1f); } playerTeam.BroadcastTeamChat(player.userID, displayName, message, color); return true; } } else if (Chat.globalchat) { ConsoleNetwork.BroadcastToAllClients("chat.add2", 0, player.userID, message, displayName, color, 1f); return true; } if (player == null) return true; var radius = 2500f; foreach (var basePlayer in BasePlayer.activePlayerList) { var sqrMagnitude = (basePlayer.transform.position - player.transform.position).sqrMagnitude; if (sqrMagnitude <= radius) { ConsoleNetwork.SendClientCommand(basePlayer.net.connection, "chat.add2", 0, player.userID, message, displayName, color, Mathf.Clamp01(radius - sqrMagnitude + 0.2f)); } } return true; } } }
Hola, puse ese archivo corregido pero no estΓ‘ bien (no da error) pero escribe dos veces las cosas en el chat, una con los datos del betterchat y otra vez solo con tu nombre.
La actualizaciΓ³n del archivo no tiene nada que ver con el doble chat, ese es un problema de BetterChat.
anisb3lI pasted the fixed cs, till the dev fix the one on uMod
using System; using CompanionServer; using ConVar; using Facepunch; using Facepunch.Math; using UnityEngine; namespace Oxide.Plugins { [Info("No Green", "Iv Misticos", "1.3.10")] [Description("Remove admins' green names")] class NoGreen : RustPlugin { private bool OnPlayerChat(BasePlayer player, string message, Chat.ChatChannel channel) { if (Chat.serverlog) { // β Fixed: replaced unsupported PrintColoured with Puts() Puts($"[{channel}] {player.displayName}: {message}"); var str = (player != null ? player.ToString() : null) ?? $"{player.displayName}[{player.userID}]"; if (channel == Chat.ChatChannel.Team) { DebugEx.Log("[TEAM CHAT] " + str + " : " + message); } else { DebugEx.Log("[CHAT] " + str + " : " + message); } } var color = "#5af"; var displayName = player.displayName.EscapeRichText(); var chatEntry = new Chat.ChatEntry { Channel = channel, Message = message, UserId = player.UserIDString, Username = displayName, Color = color, Time = Epoch.Current }; RCon.Broadcast(RCon.LogType.Chat, chatEntry); if (channel != Chat.ChatChannel.Global) { if (channel == Chat.ChatChannel.Team) { var playerTeam = RelationshipManager.ServerInstance.FindPlayersTeam(player.userID); if (playerTeam == null) { return false; } var onlineMemberConnections = playerTeam.GetOnlineMemberConnections(); if (onlineMemberConnections != null) { ConsoleNetwork.SendClientCommand(onlineMemberConnections, "chat.add2", 1, player.userID, message, displayName, color, 1f); } playerTeam.BroadcastTeamChat(player.userID, displayName, message, color); return true; } } else if (Chat.globalchat) { ConsoleNetwork.BroadcastToAllClients("chat.add2", 0, player.userID, message, displayName, color, 1f); return true; } if (player == null) return true; var radius = 2500f; foreach (var basePlayer in BasePlayer.activePlayerList) { var sqrMagnitude = (basePlayer.transform.position - player.transform.position).sqrMagnitude; if (sqrMagnitude <= radius) { ConsoleNetwork.SendClientCommand(basePlayer.net.connection, "chat.add2", 0, player.userID, message, displayName, color, Mathf.Clamp01(radius - sqrMagnitude + 0.2f)); } } return true; } } }
isn't AI awesome? π
No, this is stupid. The code is very out dated. I don't understand why misticos has so many plugins, and can't be bothered to maintain them.
For what this does it should just get patched at startup. Calling a hook all the time, and breaking other functionally is bad.
This is all you need. I know the usings at the top would be different, so just slip this into a plugin that already uses AutoPatch.
[HarmonyPatch(typeof(ConVar.Chat), "GetNameColor"), AutoPatch]
internal class Chat_GetNameColor {
static bool Prefix(ConVar.Chat __instance, ref string __result) {
__result = "#5af"; return false;
}
}
β