Dont remove it from the file manually, use the chat or console commands.
Chat Handler [Unmaintained]
Discussion in 'Plugin Support' started by Domestos, Nov 2, 2014.
-
-
-
yes he did get auto muted
-
Can someone help me??
I want to make like 3 different groups and colors in chat. Like normaluser, moderator and admin. Now do I just have to add moderator but i cant make it work. I've already added this to the .lua :
Code:if IsModerator(player) then color = self.Config.Settings.NameColor.Moderator end
"Moderator": "01B124"
But i got the following message in Rusty:
Code:[Oxide] 2:53 PM [Error] Failed to call hook 'OnPlayerChat' on plugin 'Chat Handler' File: chathandler.lua Line: 220 attempt to call global 'IsModerator' (a nil value): at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0 at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:
-
Wulf Community Admin
-
Code:
-- broadcasts chat messages -- -------------------------------- function PLUGIN:BroadcastChat(player, name, msg) local steamID = rust.UserIDFromPlayer(player) local color = self.Config.Settings.NameColor.NormalUser if IsModerator(player) then color = self.Config.Settings.NameColor.Moderator end if IsAdmin(player) then color = self.Config.Settings.NameColor.Admin end if AdminMode[steamID] then color = self.Config.Settings.NameColor.AdminMode global.ConsoleSystem.Broadcast("chat.add", 0, "<color="..color..">"..name.."</color> "..msg) else global.ConsoleSystem.Broadcast("chat.add", steamID, "<color="..color..">"..player.displayName.."</color> "..msg) end end
-
If you want to do something like this yourself there is a bit more to do than just adding 3 lines of code. -
-
Wulf Community Admin
-
-
Code:
local function IsModerator(player) return player:GetComponent("BaseNetworkable").net.connection.authLevel == 1 end
Code:local function IsAdmin(player) return player:GetComponent("BaseNetworkable").net.connection.authLevel == 2 end
Last edited by a moderator: Mar 11, 2015 -
Hey I'm having an issue that I can't figure out. I'm currently using Chat Handler and I've set the color for admins and moderators using the html color code and it works but my name is green while admins etc is red. Anyone know what the issue could be?
Thanks! -
-
-
Code:
{ "WordFilter": { "nigger": "****", "cunt": "twat" }, "Settings": { "Wordfilter": { "ReplaceFullWord": "true", "EnableWordfilter": "false" }, "NameColor": { "Admin": "#FA5858", "AdminMode": "#FA5858", "NormalUser": "#5af" }, "AdminMode": { "ReplaceChatName": "false", "AdminChatName": "[Server Admin]" }, "AntiSpam": { "EnableAntiSpam": "true", "TimeFrame": 6, "MaxLines": 4 }, "Logging": { "LogToFile": "false", "LogToConsole": "true", "LogBlockedMessages": "true" }, "General": { "BlockServerAds": "true", "Language": "en", "AllowedIPsToPost": [], "EnableChatHistory": "true", "ChatHistoryMaxLines": 10, "BroadcastMutes": "true" }, "ChatCommands": { "Wordfilter": [ "wordfilter" ], "ChatHistory": [ "history", "h" ], "Mute": [ "mute" ], "Unmute": [ "unmute" ], "AdminMode": [ "admin" ], "GlobalMute": [ "globalmute" ] } } }
-
So what exactly isnt working as you expected? -
All my admins and moderators are red like they should be but Im green for some reason. shouldnt I be red as im auth level 2
-
-
I have notifier and RotAG-Groups