1. hi guys got a plugin on the go and its giving me errors can anyone give pointers to why even tho the plugin is working fully its just spamming console

    Code:
    (19:42:19) | [Oxide] 19:42 [Error] Failed to call hook 'OnEntityDeath' on plugin 'NPCRewards v1.0.0' (NullReferenceException: Object reference not set to an instance of an object)
    (19:42:19) | [Oxide] 19:42 [Stacktrace]   at Oxide.Plugins.NPCRewards.OnEntityDeath (.BaseEntity entity, .HitInfo hitinfo, .HitInfo info) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.NPCRewards.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0
    (19:42:24) | [Oxide] 19:42 [Error] Failed to call hook 'OnEntityDeath' on plugin 'NPCRewards v1.0.0' (NullReferenceException: Object reference not set to an instance of an object)
    (19:42:24) | [Oxide] 19:42 [Stacktrace]   at Oxide.Plugins.NPCRewards.OnEntityDeath (.BaseEntity entity, .HitInfo hitinfo, .HitInfo info) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.NPCRewards.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0
     
  2. Wulf

    Wulf Community Admin

    If that is a private plugin, I'd recommend contacting the author for a fix. Without seeing the code, we can't really direct you to a fix aside from saying add some null checks.
     
  3. its not such a private plugin but if you pm me i can send you the file its a custom made plugin im work on :D
     
  4. Well, I made the plugin then put the code into this hook.
    Code:
     OnKillNPC(BasePlayer npc, BasePlayer player)
    Whenever I try to do so little as send a message to the player I get an error. The actual code works fine when put into a chat command and used on a BasePlayer.
     
    Last edited by a moderator: Jul 5, 2017