NullReferenceException at ConsoleCommandError
Hi Ultra,

I'm getting the following error in the console when trying to use the new command. 

Failed to call hook 'ConsoleCommand' on plugin 'ScientistNames v1.1.3' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.ScientistNames.ConsoleCommand (ConsoleSystem+Arg arg) [0x00006] in <9cfb006d1b9e4c3c8f923ab6e9aae4f1>:0
at Oxide.Plugins.ScientistNames.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00111] in <9cfb006d1b9e4c3c8f923ab6e9aae4f1>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <1e2d7ad0801a4037ab6a24578c814b54>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <1fe782f4b27a43ae85d29ebb2d56c007>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <1fe782f4b27a43ae85d29ebb2d56c007>:0​

Any help would be greatly appreciated.

Many Thanks
I can't replicate that. I tried ConsoleCommand and all seems to be ok. I can even see the new name in the config file immediately. What did you type exactly?
I typed 'addname Lays' directly into the cmd
Still having issue with this, have tried with it being the only plugin installed as well. 
Cleaned out my data and config folders also. Latest version of rust and oxide.

I changed the command to addsname just to see if it was command conflit incase you spot that in the screen shot below.



Merged post

Completely fresh Rust Dedicated install and Oxide, i can't think of anything else :/

> addname billy
Failed to call hook 'ConsoleCommand' on plugin 'ScientistNames v1.1.3' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.ScientistNames.ConsoleCommand (ConsoleSystem+Arg arg) [0x00006] in <442abc5f8c474a739b2be7e4fba0880d>:0
  at Oxide.Plugins.ScientistNames.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00111] in <442abc5f8c474a739b2be7e4fba0880d>:0
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <d09a1f46ca2f4432811bcfe45ad13c7b>:0
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <cf88a28c7fb44d36890d85a78331cc9d>:0
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <cf88a28c7fb44d36890d85a78331cc9d>:0
> o.version
Oxide.Rust Version: 2.0.4677
> o.plugins
Listing 1 plugins:
  01 "Scientist Names" (1.1.3) by Ultra (0.02s) - ScientistNames.cs
Chat command is working properly?
5d2e4d835505b.png Ultra
Chat command is working properly?

Chat command working fine. I don't see any feedback ingame or inconsole when adding the name. But checking the json file i do see the name has appeared.

Any luck with this problem?
I can't replicate this issue.
SOhcD4HVgUlXbBo.png Ultra
I can't replicate this issue.

Ok, no worries. Appreciate you looking. 

Merged post

He Ultra, someone in my community pointed out something that might help and it does allow it to work...but has a downside.
I guess as Tebex is sending the command and i'm using an RCON (rustadmin.com) panel instead of the console ingame this is why you might not have seen the errors or been able to reproduce.

The problem seems to be as follows: The plugin checks permission based on the player. But in the console, if the console user is not a known player in the game it bugs out trying to see if the player has permissions. The player does not exist, hence 'Object not set to an instance of an object'
 
So by removing that security check, it will not look for the player.

The error is from the plugin assuming a player is using the console command.
5e13a8d5b2bc5.jpg Wulf
The error is from the plugin assuming a player is using the console command.

It appears when i'm inputting the command in the cmd line in RustAdmin.com or when Tebex sends the command when someone buys a package that also includes adding them as a scientist name. 

via chat command ingame it works fine.
Got it sorted, these are the changes we made. From my understanding it was trying to check permissions to the player, but as it was going through rcon no player is associated...i might have wrong though. However pastebin link to what we did and it's working.  Thank you for baring with me over all of this. It's a much loved plugin of the server.

I can confirm that this issue is still occurring.

(18:52:38) | Failed to call hook 'ConsoleCommand' on plugin 'ScientistNames v1.1.3' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.ScientistNames.ConsoleCommand (ConsoleSystem+Arg arg) [0x00006] in <d657c563cf384d75b64c44eea182aecb>:0 
  at Oxide.Plugins.ScientistNames.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00111] in <d657c563cf384d75b64c44eea182aecb>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <80b90e8213db44b29ec2d4111764172c>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <ec05e0208c9149bba43236ca58fea105>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <ec05e0208c9149bba43236ca58fea105>:0​