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
NullReferenceException with my NPCRewards plugin
Discussion in 'Rust Development' started by Wombat, Jul 5, 2017.
-
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.
-
-
Well, I made the plugin then put the code into this hook.
Code:OnKillNPC(BasePlayer npc, BasePlayer player)
Last edited by a moderator: Jul 5, 2017