NullReferenceException at OnPlayerDeathFixed
Hi Wulf i have issue , i use only the economic system with the penalty on death when i test on my server then plugin crash in console like that can you check that please ?

Failed to call hook 'OnPlayerDeath' on plugin 'Punish v1.0.0' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.Punish.OnPlayerDeath (BasePlayer basePlayer, HitInfo hitInfo) [0x00028] in <fcc76417ccfc41e4976078f2286a1df7>:0
at Oxide.Plugins.Punish.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00096] in <fcc76417ccfc41e4976078f2286a1df7>: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​
Thanks for the report. Currently looking into it to see if I can see what's going on.

Edit: Posting an update that should fix the issue.
Thanks Wulf 👍😁

Merged post

hi wulf i have same type of issue not the same but i think is related thanks for your support just for info i use the economics system 3.8.5.
Detonator38
hi wulf i have same type of issue not the same but i think is related thanks for your support just for info i use the economics system 3.8.5.

Could you show me the error you are receiving now? Thanks.

Failed to call hook 'OnPlayerDeath' on plugin 'Punish v1.1.0' (InvalidCastException: Null object cannot be converted to a value type.)
  at System.Convert.ChangeType (System.Object value, System.Type conversionType, System.IFormatProvider provider) [0x00029] in <437ba245d8404784b9fbab9b439ac908>:0
  at System.Convert.ChangeType (System.Object value, System.Type conversionType) [0x0000c] in <437ba245d8404784b9fbab9b439ac908>:0
  at Oxide.Core.Plugins.Plugin.Call[T] (System.String hook, System.Object[] args) [0x00008] in <cf88a28c7fb44d36890d85a78331cc9d>:0
  at Oxide.Plugins.Punish.PunishPlayer (Oxide.Plugins.Punish+Punishment punishment, Oxide.Core.Libraries.Covalence.IPlayer player, System.String reason) [0x00060] in <7214e0c2541d4504b07943785cdea013>:0
  at Oxide.Plugins.Punish.OnPlayerDeath (BasePlayer basePlayer, HitInfo hitInfo) [0x000aa] in <7214e0c2541d4504b07943785cdea013>:0
  at Oxide.Plugins.Punish.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00096] in <7214e0c2541d4504b07943785cdea013>: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

That isn't the same error, but I'll take a look. Are you using Economics and Server Rewards, or just Economics?

i use both them but server reward it's just there for require use from another plugin and i activate juste one value and it's Economics withdrawl at true in Punish for dying section and i changed from default 1000 to 300 like value.
03/20 22:42:37 | Failed to call hook 'OnPlayerDeath' on plugin 'Punish v1.1.0' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.Punish.OnPlayerDeath (BasePlayer basePlayer, HitInfo hitInfo) [0x0000b] in <3c4e177ea7be40cfb716e98fc33d8b11>:0
at Oxide.Plugins.Punish.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00096] in <3c4e177ea7be40cfb716e98fc33d8b11>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <3606d2af539c45e4b5c61658e6a8b307>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <c2afd8354b8b4f3ca451cf5a1aa111c3>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <c2afd8354b8b4f3ca451cf5a1aa111c3>:0

I use Server Rewards

Hi Wulf- 

I keep getting this error. IS there perhaps a fix for this or is there something I'm doing wrong?

Here's the log:

05:56 [Error] Failed to call hook 'OnPlayerDeath' on plugin 'Punish v1.1.1' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.Punish.OnPlayerDeath (BasePlayer basePlayer, HitInfo hitInfo) [0x00097] in <50d5862c91ff48b4a204470574cebd64>:0

at Oxide.Plugins.Punish.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00096] in <50d5862c91ff48b4a204470574cebd64>:0

at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <31122a27a2414cd799150f8677cf39d4>:0

at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <0fbce81d88d64454b3e7abb24df7026b>:0

at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <0fbce81d88d64454b3e7abb24df7026b>:0

Will try to look into this soon.

Also here's the current config:

{
"Punish for dying": {
"Enable punishment": true,
"Ban as punishment": false,
"Hurt as punishment": 0.0,
"Kick as punishment": false,
"Jail as punishment": false,
"Name of jail/prison to use": "",
"Amount of time to jail": 10,
"Slap as punishment": false,
"Amount of damage per slap": 10,
"Intensity of each slap": 5,
"Number of times to slap": 1,
"Economics withdrawl": true,
"Economics amount": 1,
"Server Rewards withdrawl": false,
"Server Rewards amount": 100
},
"Punish for killing other players": {
"Enable punishment": false,
"Ban as punishment": false,
"Hurt as punishment": 0.0,
"Kick as punishment": false,
"Jail as punishment": false,
"Name of jail/prison to use": "",
"Amount of time to jail": 10,
"Slap as punishment": false,
"Amount of damage per slap": 10,
"Intensity of each slap": 5,
"Number of times to slap": 1,
"Economics withdrawl": false,
"Economics amount": 0,
"Server Rewards withdrawl": false,
"Server Rewards amount": 100
},
"Include actions from NPCs": true,
"Use permission system": false
}
Locked automatically