BetterChat

Moved

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

4.9898/5, 98 likes
  1. Hello LaserHydra,

    I'm working on a small server manager working with RCON (GitHub - MarlBurroW/rust-commander).
    It's hard for me to handle BetterChat messages via RCON because it doesn't send the default chat message event (I just see a generic message for logging).

    * BetterChat generic event: https://i.imgur.com/asS9s9D.png
    This one seems to be an automatic generic event triggered bv oxide for logging.

    * Expected additional event: https://i.imgur.com/RclQx3B.png
    This is the "standard" event to handle chat message via rcon, unfortunately this one is not sent when BetterChat is enabled.

    As you can see on the "standard" event, the Message property is a JSON string with some information about the message like the player ID (this help to manage many internal feature in my app). Do you think you can trigger an additional RCON event with the same format to "simulate" the default RCON chat message event ? I don't know Oxide so I don't know if it's possible to send RCON messages via the API.

    I think all 3rdparty apps use this event to handle chat messages so it's important to keep it.

    What do you think ?

    Thanks
     
    Last edited by a moderator: Sep 15, 2017
  2. Hello,

    I was wondering how do i get the primary group of a player in a different plugin?
     
  3. i still have this spamming my console sometimes
    Code:
    Failed to call hook 'OnUserChat' on plugin 'BetterChat v5.0.12' (NullReferenceException: Object reference not set to an instance of an object)
      at Oxide.Plugins.BetterChat.OnUserChat (IPlayer player, System.String message) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.BetterChat.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0 
     
  4. That is an error in the PlayerChallenges plugin as seen in the message.
    [DOUBLEPOST=1505823751][/DOUBLEPOST]
    Make sure you have a "default" group.
    [DOUBLEPOST=1505823828][/DOUBLEPOST]
    I'll look into this.
    [DOUBLEPOST=1505823854][/DOUBLEPOST]
    That is currently not implemented into the API, but I'll try to fit it into the next update.

    Though: If your plugin requires BetterChat (fully depends on BC) , you can add "// Requires: BetterChat" at the top of your plugin and use BetterChat's classes directly.
     
    Last edited by a moderator: Sep 19, 2017
  5. LaserHydra updated Better Chat with a new update entry:

    5.0.13

     
  6. Awesome! I really appreciate it!

    This will get all of the users groups, right? How do i go about getting the primary group?
     
  7. thank you ..
    but i don't need the default group i can't remove it ?
     
  8. This is how its done in BetterChat:

    Code:
    ChatGroup primary = null;foreach (ChatGroup group in groups)
        if (primary == null || group.Priority < primary.Priority)
            primary = group;
     
  9. Wulf

    Wulf Community Admin

    The default group is from Oxide and everyone will always be in it automatically.
     
  10. There should always be a default group, before this update it would just throw an error if a player wasn't in any group.

    The default group is for all players. So if you don't want the default players to look different, just change their colors to the game default.
     
  11. i removed my self from the default group and add my self to Admin group and its work good
    [ADMIN] Arkan : test chat

    till i disconnect and reconnect again
    its show that i have 2 groups in chat like this :
    [Player] [ADMIN] Arkan : test chat
     
  12. Enable "HiddenIfNotDefault" for the default group. That - if you set up your priorities correctly - will hide the player tag if you're admin.
     
  13. i set the priorities but it just reorder the groups
    ADMIN PLAYER Arkan : chat

    how to Enable "HiddenIfNotDefault" ?
     
  14. In the BetterChat.json file under data folder.
     
  15. like this ?

    Code:
      {
        "GroupName": "default",
        "Priority": 0,
        "Title": {
          "Text": "[Player]",
          "Color": "#55aaff",
          "Size": 15,
          "Hidden": false,
          "HiddenIfNotPrimary": true
        },
        "Username": {
          "Color": "#55aaff",
          "Size": 15
        },
        "Message": {
          "Color": "white",
          "Size": 15
        },
        "Format": {
          "Chat": "{Title} {Username}: {Message}",
          "Console": "{Title} {Username}: {Message}"
        }
     
  16. I believe so yes. Remember to set the priority on the groups.

    -------

    Hey @LaserHydra is this the correct way to call for the API to get the groups?

    Code:
    var UserGroups = (List<object>)BetterChat?.Call("API_GetUserGroups", player);
     
  17. nop .. still the same problem ..
    i hide the whole group to fix this problem :/
     
  18. Have you set the priority on the admin rank to be higher?
     
  19. yes admin priority is 1
    and players 0
     
  20. Have you reloaded the plugin? If so could you provide the whole .json?