Thank.you for doing that. I Wanted to do some cleanup and stuff anyways in one of my next updates, thanks.
[DOUBLEPOST=1429852808][/DOUBLEPOST]Also I see you removed the console chat print?
BetterChat
Moved
Total Downloads: 26,139 - First Release: Apr 21, 2015 - Last Update: Jan 12, 2018
- 4.9898/5, 98 likes
-
LaserHydra updated Name Colors with a new update entry:
Wulf
-
Wulf Community Admin
Also, I had added this in an updated version locally, which may give you a nicer color list:
Code:rust.SendChatMessage(player, "<b><size=15>Available name colors:" .. colors .. "</size></b>")
-
[DOUBLEPOST=1429853535][/DOUBLEPOST]
[DOUBLEPOST=1429865884,1429853197][/DOUBLEPOST] -
Hey,
I just wanna use the vip Feature without the auth... but it seems i cant deactivate them :/
I wanna give just a Special Group colord nicks all others should Keep normal. -
)
Owner: #ACFA58
Mod: #ACFA58
Player: #58ACFALast edited by a moderator: Apr 24, 2015 -
-
You just need to set PermissionsEnabled to true
maybe delete your old config, and reload the plugin to generate the new one as it got a little bit changed
[DOUBLEPOST=1429880214][/DOUBLEPOST]Okay I understood what you want. But yeah you can just use the permissions system and give VIP the color you want and change the other colors to those I told you. -
This double chats with chathandler installed
-
Im maybe trying to make it compatible but thats not a high priority at the moment. -
Wulf Community Admin
-
Thanks Wulf! -
Well but I need to have a disabled auth colors. Means I wanna keep them like they are standard. And wanna create a group for vip but this does not work right now I'm right?
-
If I use this mod with Ranks and Titles it duplicate my name
-
-
Wulf Community Admin
A few other recommend changes for you, as auth level checking shouldn't even be needed as default groups are there no matter what. This shortens and simplifies your plugin significantly. I've also switch to only changing the name instead of modifying the chat, so this should fix any conflicts.
Code:PLUGIN.Title = "Name Colors" PLUGIN.Description = "Change default chat name colors for users by permission group." PLUGIN.Author = "LaserHydra" PLUGIN.Version = V(1, 2, 0) PLUGIN.ResourceId = 979function PLUGIN:LoadDefaultConfig() self.Config.Colors = self.Config.Colors or {} self.Config.Colors.Player = self.Config.Colors.Player or "lime" self.Config.Colors.Moderator = self.Config.Colors.Moderator or "yellow" self.Config.Colors.Owner = self.Config.Colors.Owner or "orange" self.Config.Colors.VIP = self.Config.Colors.VIP or "aqua" self.Config.PermissionsEnabled = nil -- Removed self.Config.AuthlevelEnabled = nil -- Removed self.Config.ConsoleWarningDelaySeconds = nil -- Removed self.Config.AuthlevelColors = nil -- Removed self.Config.PermissionColors = nil -- Removed self:SaveConfig() endfunction PLUGIN:Init() command.AddChatCommand("colors", self.Plugin, "ColorList") if not permission.GroupExists("vip") then permission.CreateGroup("vip", "V.I.P.", 0) end self:LoadDefaultConfig() endfunction PLUGIN:ColorList(player) local colorList = { "aqua", "black", "blue", "brown", "darkblue", "green", "grey", "lightblue", "lime", "magenta", "maroon", "navy", "olive", "orange", "purple", "red", "silver", "teal", "white", "yellow" } local colors = "" for k, color in pairs(colorList) do colors = colors .. "\n" .. "<color=" .. color .. ">" .. string.upper(color) .. "</color>" end rust.SendChatMessage(player, "<b><size=15>Available name colors:" .. colors .. "</size></b>") endfunction PLUGIN:OnPlayerConnected(packet) if not packet then return end if not packet.connection then return end local connection = packet.connection local steamId = rust.UserIDFromConnection(connection) local groups = permission.GetUserGroups(steamID):GetEnumerator() while groups:MoveNext() do if groups.Current == "admin" then connection.username = "<color=" .. self.Config.Colors.Owner .. ">" .. connection.username break elseif groups.Current == "moderator" then connection.username = "<color=" .. self.Config.Colors.Moderator .. ">" .. connection.username break elseif groups.Current == "vip" then connection.username = "<color=" .. self.Config.Colors.VIP .. ">" .. connection.username break else connection.username = "<color=" .. self.Config.Colors.Player .. ">" .. connection.username end end end
Code:{ "Colors": { "Owner": "orange", "Moderator": "yellow", "VIP": "aqua", "Player": "lime" } }
Last edited: Apr 24, 2015 -
[DOUBLEPOST=1429894776][/DOUBLEPOST] -
Wulf Community Admin
-
#WulfDidMyJob
XD -
@LaserHydra If you want to add more Ranks And Titles support you can call my function
Code:grabPlayerData: function(steamID, key) { return TitlesData.PlayerData[steamID][key]; }
for instance if you want to grab the title in lua you can do:
Code:RanksAndTitles:Call("grabPlayerData", steamID, "Title")
If you need help or you want to do something on this end let me know so I can add a find for your plugin to disable chat on my end. So double posts don't happen.
and if you want to do Color for said title you can also pull that from my plugin with my functionCode:getColor
Last edited by a moderator: Apr 24, 2015