BetterChat

Moved

Total Downloads: 26,148 - First Release: Apr 21, 2015 - Last Update: Jan 12, 2018

4.9898/5, 98 likes
  1. Go to your oxide/data folder and upload the betterchat.json file to here using the upload a file option do not paste the file only upload it
     
  2. Hello i was just wondering how to fix so clan tags show in the main chat of the game i cant find anything about
     
  3. How is possible that LaserHydra didn't added the "Anti-Flood" system? The oldest version has it. Could anyone add it to the newest? Thanks
     
  4. It's not possible to change the username color.
    I won't get feedback if I try it via console neither the group manager solves my problem.
    The user tags are correctly displayed.

    Also If make the chat format to {name}: {message} the title is still there.
    My intention was to have a group just with a tag, but no username color.
    The other groups have usernamecolors and which with the highest priority had to be displayed there.
    But no, it don't.

    Code:
    [
      {
        "GroupName": "admin",
        "Priority": 0,
        "IgnoreOtherGroups": false,
        "Title": {
          "Hidden": false,
          "Size": 15,
          "Color": "#369369",
          "Text": "[admin]"
        },
        "PlayerName": {
          "Size": 15,
          "Color": "#369369"
        },
        "Message": {
          "Size": 15,
          "Color": "white"
        },
        "Formatting": {
          "Console": "{Name}: {Message}",
          "Chat": "{Name}: {Message}"
        }
      },
      {
        "GroupName": "default",
        "Priority": 4,
        "IgnoreOtherGroups": false,
        "Title": {
          "Hidden": false,
          "Size": 15,
          "Color": "#D8D8D8",
          "Text": "[Player]"
        },
        "PlayerName": {
          "Size": 15,
          "Color": "#D8D8D8"
        },
        "Message": {
          "Size": 15,
          "Color": "white"
        },
        "Formatting": {
          "Console": "{Name}: {Message}",
          "Chat": "{Name}: {Message}"
        }
      },
      {
        "GroupName": "donator",
        "Priority": 3,
        "IgnoreOtherGroups": true,
        "Title": {
          "Hidden": false,
          "Size": 15,
          "Color": "#009BFF",
          "Text": "[Donator]"
        },
        "PlayerName": {
          "Size": 15,
          "Color": "#009BFF"
        },
        "Message": {
          "Size": 15,
          "Color": "white"
        },
        "Formatting": {
          "Console": "{Title} {Name}: {Message}",
          "Chat": "{Title} {Name}: {Message}"
        }
      },
      {
        "GroupName": "tagged",
        "Priority": 1,
        "IgnoreOtherGroups": false,
        "Title": {
          "Hidden": false,
          "Size": 15,
          "Color": "#8A0808",
          "Text": "[Tagged Group]"
        },
        "PlayerName": {
          "Size": 15,
          "Color": ""
        },
        "Message": {
          "Size": 15,
          "Color": "white"
        },
        "Formatting": {
          "Console": "{Title} {Name}: {Message}",
          "Chat": "{Title} {Name}: {Message}"
        }
      },
      {
        "GroupName": "mod",
        "Priority": 2,
        "IgnoreOtherGroups": false,
        "Title": {
          "Hidden": false,
          "Size": 15,
          "Color": "#FF9900",
          "Text": "[mod]"
        },
        "PlayerName": {
          "Size": 15,
          "Color": "#FF9900"
        },
        "Message": {
          "Size": 15,
          "Color": "white"
        },
        "Formatting": {
          "Console": "{Name}: {Message}",
          "Chat": "{Name}: {Message}"
        }
      }
    ]
     
  5. just a little problem im having since last rust update when a player ranks up with play time tags its double tagging and i am having to remove the prev tag is there a fix to this?
     
  6. Code:
    "GroupName": "default",
        "Priority": 4,
        "Title": {
          "Text": "[Player]",
          "Color": "#55aaff",
          "Size": 15,
          "Hidden": false,
          "HiddenIfNotPrimary": true
        },
        "Username": {
          "Color": "#DCFF66",
          "Size": 15
        },
        "Message": {
          "Color": "white",
          "Size": 15
        },
        "Format": {
          "Chat": "{Title} {Username}: {Message}",
          "Console": "{Title} {Username}: {Message}"
    You have that file all wrong this is the way each one should be so you need to fully fix that file
     
  7. Thanks for your answer and yes you were right. :)
    But I have still the problem that I can't have the title of one group and the usernamecolor of another group. :/

    nvm, solved it by myself.
    But thank you again. :)
     
    Last edited by a moderator: Mar 7, 2017
  8. How is it done colorful?

    Help Me Please?
     

    Attached Files:

  9. Can the OnUserChat hook be updated to allow OnBetterChat hooks to override the OnUserChat function itself?

    Consider the following example plugin:
    Code:
    using Oxide.Core;
    using Oxide.Core.Plugins;
    using Oxide.Core.Libraries.Covalence;namespace Oxide.Plugins
    {
        [Info("Sample Plugin", "", "1.0")]
        class SamplePlugin : RustPlugin
        {
            [PluginReference] Plugin BetterChat;        [HookMethod("OnBetterChat")]
            private object SampleOnBetterChat(IPlayer player, string message)
            {
                if(message.Contains("$"))
                {
                    rust.RunServerCommand("say", "Someone had a $ in their message!");
                    return true;
                }            return null;
            }
        }
    }
    For reference, the current BetterChat code is as follows:
    Code:
           object OnUserChat(IPlayer player, string message)
            {
                object hookResult = Interface.CallHook("OnBetterChat", player, message);            if (hookResult is string)
                    message = (string) hookResult;
                else if (hookResult != null)
                    return null;            var output = ChatGroup.FormatMessage(player, message);            if (output == null)
                    return null;#if RUST
                ConsoleNetwork.BroadcastToAllClients("chat.add", new object[] { player.Id, output.Chat });
    #else
                server.Broadcast(output.Chat);
    #endif            Puts(output.Console);            return true;
            }
    
    The issue is if hookResult isn't null, null is returned, which means to not execute the OnUserChat hook.

    However, consider the case when the dev wants the message to not be shown, as per this thread: Don't send message if it contains defined string | Oxide

    There is no way to do that currently.

    I propose the following change:
    Code:
           object OnUserChat(IPlayer player, string message)
            {
                object hookResult = Interface.CallHook("OnBetterChat", player, message);            if (hookResult is string)
                    message = (string) hookResult;
                else if (hookResult != null)
                {
                    if(hookResult is bool)
                    {
                        // If the OnBetterChat hook returns true, allow this hook to 
                        // drop the current message by not executing anything. This would
                        // break plugins that returned true already, but that isn't the 
                        // normal convention being used for these hooks it seems.
                        if((bool)hookResult)
                            return hookResult;
                       
                        // Otherwise, keep original behavior to avoid breaking existing plugins 
                        // that already returned false.
                        return null;
                    }
                    else
                    {
                        return null; // Keep original behavior to avoid breaking existing plugins.
                    }
                }            var output = ChatGroup.FormatMessage(player, message);            if (output == null)
                    return null;#if RUST
                ConsoleNetwork.BroadcastToAllClients("chat.add", new object[] { player.Id, output.Chat });
    #else
                server.Broadcast(output.Chat);
    #endif            Puts(output.Console);            return true;
            }
    
    As mentioned in the comment, any existing plugin that returned true would break, but it's the least destructive change I can think of to support this.
     
  10. I don't understand why it's showing vip tag for me, whilst I'm the admin (I added myself into all the groups. otherwise it won't allow me to use certain kits, faster home tp etc) Also it used to give me default tag when i relogged, I don't understand what I did wrong.. Anyone able to help?
    Thanks in advance

    Edit: I did the priority thing wrong on everything >.> Foolish me, think I solved the issue now, thanks anyways!
     
    Last edited by a moderator: Mar 9, 2017
  11. Hey guys. So when I join my server i get put back into the default group instead of keeping me in the admin group, also it says [Admin] [Player] when i speak in chat. I will leave My BetterChat data file down below.

    Also is there anyway I can attach The BetterChat groups to the Oxide groups so that I dont have to remove myslef from the chat group i left everytime i enter a new one because it always has 2 prefixes before my name.

    Code:
    [
      {
        "GroupName": "default",
        "Priority": 1,
        "Title": {
          "Text": "[Player]",
          "Color": "#42A3FF",
          "Size": 15,
          "Hidden": false,
          "HiddenIfNotPrimary": false
        },
        "Username": {
          "Color": "#42A3FF",
          "Size": 15
        },
        "Message": {
          "Color": "white",
          "Size": 15
        },
        "Format": {
          "Chat": "{Title} {Username}: {Message}",
          "Console": "{Title} {Username}: {Message}"
        }
      },
      {
        "GroupName": "hey",
        "Priority": 0,
        "Title": {
          "Text": "[Admin]",
          "Color": "#FB6542",
          "Size": 15,
          "Hidden": false,
          "HiddenIfNotPrimary": false
        },
        "Username": {
          "Color": "FFBB00",
          "Size": 15
        },
        "Message": {
          "Color": "white",
          "Size": 15
        },
        "Format": {
          "Chat": "{Title} {Username}<color=white>:</color> {Message}",
          "Console": "{Title} {Username}: {Message}"
        }
      }
    ]
     
  12. For both
    "HiddenIfNotPrimary": true
     
  13. Thanks :)
    Is there anyway to make the chat groups work with the oxide groups?
     
  14. Wulf

    Wulf Community Admin

    The chat groups are Oxide groups, the plugin uses Oxide's permission system.
     
  15. "Error while compiling: BetterChat.cs(98,30): error CS1955: The member `BasePlayer.IsDeveloper' cannot be used as method or delegate"
    Since last update please fix
     
  16. [03/09/2017 17:07:55] Error while compiling: BetterChat.cs(98,30): error CS1955: The member `BasePlayer.IsDeveloper' cannot be used as method or delegate
     
  17. Apologies for my last post that was deleted. For everyone that is having an issue with the new error that was caused by the rust update on 3/9/17, you only have to make one change and it will resolve the issue.

    On line 98 in BetterChat.cs, change 'IsDeveloper()' to 'IsDeveloper'. Simply remove the parentheses and save the file.
     
  18. Error while compiling: BetterChat.cs(399,29): error CS1955: The member `BasePlayer.IsDeveloper' cannot be used as method or delegate

    HELP!
     
  19. Check my post right before yours. All you have to do is go to line 399 in BetterChat.cs, and remove the parentheses after 'IsDeveloper()'.

    The code should look similar to this:

    Code:
    #if RUST
                    BasePlayer bPlayer = BasePlayer.Find(SteamID);                if (bPlayer.IsDeveloper)
                    {
                        groups.Add(Plugin.GameDeveloperGroup);
                    }
    #endif
     
  20. Wulf

    Wulf Community Admin

    Wulf updated Better Chat with a new update entry:

    5.0.5