Failed to call hook 'ShowConsoleInfo' on plugin 'ServerInfo v0.5.8' (ArgumentNullException: Value cannot be null.
Parameter name: source)
at System.Linq.Enumerable.Count[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0000d] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
at Oxide.Plugins.ServerInfo.ShowInfo (BasePlayer player, System.String command, System.String[] args) [0x0009b] in <1d52fa70cc544c4b99f937d6b39290f7>:0
at Oxide.Plugins.ServerInfo.ShowConsoleInfo (ConsoleSystem+Arg arg) [0x0006f] in <1d52fa70cc544c4b99f937d6b39290f7>:0
at Oxide.Plugins.ServerInfo.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00369] in <1d52fa70cc544c4b99f937d6b39290f7>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <09575a60985045248bcb43b20faeeb99>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in :0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in :0
Help button does nothing
I have to agree ... what exactly is this 'Help' button supposed to do for us anyway? I would assume it should open the information panel vs. having to type in a chat/console command ... but it doesn't appear to do anything at the moment :(
Problem is the button push is pointing to code that doesn't work, it's console command "info" which does nothing. So with some trial and error I was able to make the button finally open the ServerInfo so you don't have to type /info.
In the ServerInfo.cs file you need to change the code for console command info. Ignore the puts lines, I was using those to post to the console to debug what the code was doing.
[ConsoleCommand("info")]
private void ShowConsoleInfo(ConsoleSystem.Arg arg)
{
if (arg == null || arg.Connection == null || arg.Connection.player == null || _settings == null)
{
Puts("I'm at 267");
return;
}
var player = arg.Connection.player as BasePlayer;
if (player == null)
{
Puts("I'm at 274");
return;
}
if (string.IsNullOrEmpty(PlayerActiveTabs[player.userID].MainPanelName))
{
Puts("I'm at 279");
ShowInfo(player, string.Empty, new string[0]);
}
}
Just search for "CuiButton CreateHelpButton()" and change the
Command = "info",to
Command = "chat.say /info",then it should work.
Well, in my case at least there was another UI panel (or some other UI element ) rendering on top of the 'Info' button making it un-clickable.
All I did to fix this was move the button elsewhere ;)
"HelpButton": {"IsEnabled": true,
"Text": "Info",
"Position": {
"MinX": 0.0,
"MaxX": 0.05,
"MinY": 0.90,
"MaxY": 0.95
},
"Color": "#000255",
"FontSize": 18
Same, I had MagicPanel covering half of the button, so I made the button an overlay.
var helpButtonName = container.Add(helpChatButton, "Overlay"); Had some help in CodeFling Discord from Steenamaroo :)