Skip to content

OnServerMessage

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private object OnServerMessage( string message, string username, string color, ulong userid )
{
    Puts( "OnServerMessage works!" );
    return null;
}

Location

  • ConVar.Chat::Broadcast(string message, string username, string color, ulong userid)
csharp
public static void Broadcast(string message, string username = "SERVER", string color = "#eee", ulong userid = 0uL)
{
	if (Interface.CallHook("OnServerMessage", message, username, color, userid) == null)
	{
		string text = username.EscapeRichText();
		ConsoleNetwork.BroadcastToAllClients("chat.add", 2, 0, "<color=" + color + ">" + text + "</color> " + message);
		Record(new ChatEntry
		{
//---

Released under the MIT License.