Better Chat lets you change the name colors and prefixes as you want to, by using oxide permissions.
Note: The standard groups are automatically set up.
How to:
Now lets do that with the example of the V.I.P. group.
- Create a group in the config as shown in the preset groups
- Go into your chat
- Create a Oxide Group (if you want to give those Settings you made to a group) using: /group add <GROUPNAME>
- Give the Oxide group the Settings you made using: /grant group <GROUPNAME> <PERMISSION>
- or if you want to give it to a User not to a group, then do: /grant user <USERNAME> <PERMISSION>
- if you wanted to use it on groups, you can add users to the group using: /usergroup add <USERNAME> <GROUPNAME>
- creating a group:
Code (Javascript):"vip": {
"ConsoleFormatting": "{Title} {Name}: {Message}",
"Formatting": "{Title} {Name}<color={TextColor}>:</color> {Message}",
"NameColor": "yellow",
"Permission": "color_vip",
"Rank": 2,
"TextColor": "white",
"Title": "[V.I.P.]",
"TitleColor": "orange"
}- so it should look like this:
Code (Javascript):{
"mod": {
"ConsoleFormatting": "{Title} {Name}: {Message}",
"Formatting": "{Title} {Name}<color={TextColor}>:</color> {Message}",
"NameColor": "blue",
"Permission": "color_mod",
"Rank": 3,
"TextColor": "white",
"Title": "[Mod]",
"TitleColor": "yellow"
},
"owner": {
"ConsoleFormatting": "{Title} {Name}: {Message}",
"Formatting": "{Title} {Name}<color={TextColor}>:</color> {Message}",
"NameColor": "blue",
"Permission": "color_owner",
"Rank": 4,
"TextColor": "white",
"Title": "[Owner]",
"TitleColor": "red"
},
"vip": {
"ConsoleFormatting": "{Title} {Name}: {Message}",
"Formatting": "{Title} {Name}<color={TextColor}>:</color> {Message}",
"NameColor": "yellow",
"Permission": "color_vip",
"Rank": 2,
"TextColor": "white",
"Title": "[V.I.P.]",
"TitleColor": "orange"
},
"player": {
"ConsoleFormatting": "{Title} {Name}: {Message}",
"Formatting": "{Title} {Name}<color={TextColor}>:</color> {Message}",
"NameColor": "blue",
"Permission": "color_player",
"Rank": 1,
"TextColor": "white",
"Title": "[Player]",
"TitleColor": "blue"
},
"WordFilter": {
"Enabled": false,
"FilterList": [
"fuck",
"bitch",
"faggot"
]
}
}- Open up your Chat
- Type: /group add vip
- Type: /grant group vip color_vip
- Type: /usergroup add LaserHydra vip
To set priority ( means if someone has multiple groups, setting which formatting is actually used ) just change the rank of it ( the higher the value the higher the rank )
Commands:
Permissions:
- /colors shows all available colors (You can also use -> HEX Codes!)
Extra features:
- betterchat.formatting - needed for the usage of formatting tags like <color=orange>
And also just add words, letters, numbers, and symbols to it. Its everything possible. You can also just out the Title behind the name or stuff like that.
- different colors and prefixes depending on oxide groups
- You can do alot with the "Formatting" of a group. you can customize it with
- {Rank} = Group Rank
- {Title} = Group Title
- {TitleColor} = Group Title Color
- {NameColor} = Group Name Color
- {TextColor} = Group Text Color
- {Name} = Player Name
- {ID} = Player SteamID
- {Message} = Message
Standard Config file:
For Developers:Code (Javascript):{
"mod": {
"ConsoleFormatting": "{Title} {Name}: {Message}",
"Formatting": "{Title} {Name}<color={TextColor}>:</color> {Message}",
"NameColor": "blue",
"Permission": "color_mod",
"Rank": 2,
"TextColor": "white",
"Title": "[Mod]",
"TitleColor": "yellow"
},
"owner": {
"ConsoleFormatting": "{Title} {Name}: {Message}",
"Formatting": "{Title} {Name}<color={TextColor}>:</color> {Message}",
"NameColor": "blue",
"Permission": "color_owner",
"Rank": 3,
"TextColor": "white",
"Title": "[Owner]",
"TitleColor": "red"
},
"player": {
"ConsoleFormatting": "{Title} {Name}: {Message}",
"Formatting": "{Title} {Name}<color={TextColor}>:</color> {Message}",
"NameColor": "blue",
"Permission": "color_player",
"Rank": 1,
"TextColor": "white",
"Title": "[Player]",
"TitleColor": "blue"
},
"WordFilter": {
"Enabled": false,
"FilterList": [
"fuck",
"bitch",
"faggot"
]
}
}
API methods:
- Dictionary<string, object> GetPlayerFormatting(BasePlayer player)
- Dictionary<string, object> GetGroup(string name)
- List<string> GetGroups()
- List<string> GetPlayersGroups(BasePlayer player)
- bool GroupExists(string name)
- bool AddPlayerToGroup(BasePlayer player, string name)
- bool RemovePlayerFromGroup(BasePlayer player, string name)
- bool PlayerInGroup(BasePlayer player, string name)
- bool AddGroup(string name, Dictionary<string, object> name)
Data from GetPlayerFormatting(BasePlayer player):
[EXAMPLE GetPlayerFormatting(BasePlayer player)]
- Formatting = Config[Formatting]
- ConsoleFormatting = Config[ConsoleFormatting]
- GroupRank = Config[GroupRank]
- Title = Config[Title]
- TitleColor = Config[TitleColor]
- NameColor = Config[NameColor]
- TextColor = Config[TextColor]
Code (Lua):PLUGIN.Title ="Better Chat Data Grabbing"
PLUGIN.Version = V(1,0,0)
PLUGIN.Description ="Data Grabbing"
PLUGIN.Author ="LaserHydra"
function PLUGIN:Init()
command.AddChatCommand("grab", self.Object, "cmdGrab")
end
function PLUGIN:cmdGrab(player)
local betterChat = plugins.Find("BetterChat")
if betterName then
data = betterChat:Call("GetPlayerFormatting", player)
rust.SendChatMessage(player, "Your Prefix", data.Title)
rust.SendChatMessage(player, "Your Prefix Color", data.TitleColor)
rust.SendChatMessage(player, "Your Name Color", data.NameColor)
rust.SendChatMessage(player, "Your Text Color", data.TextColor)
end
endCode (C#):using System.Collections.Generic;
using System.Reflection;
using System;
using System.Data;
using Oxide.Core;
namespace Oxide.Plugins
{
[Info("Better Chat Data Grabbing", "LaserHydra", "1.0.0", ResourceId = 0)]
[Description("Data Grabbing")]
class ChatnameDataGrab : HurtworldPlugin
{
[ChatCommand("grab")]
void cmdGrab(BasePlayer player)
{
Plugin betterChat = null;
betterChat = plugins.Find("BetterChat");
if(betterChat!= null)
{
var data = betterChat.Call("GetPlayerFormatting", player);
SendReply(player, "Your Prefix: " + data.Title);
SendReply(player, "Your Prefix Color: " + data.TitleColor);
SendReply(player, "Your Name Color: " + data.NameColor);
SendReply(player, "Your Text Color: " + data.TextColor);
}
}
}
}







0 comentários:
Postar um comentário