I tried multiple hours how i can fix that but im not sure where the null comes from..
void OnPlayerDie(BasePlayer player, HitInfo info)
{
BasePlayer killer = info.Initiator as BasePlayer;
var item = killer.GetActiveItem();
var clanplayer = Clans.Call("GetClanOf", player.userID);
var clanKiller = Clans.Call("GetClanOf", killer.userID);
if (killer == null) { return; }
if (player == null) { return; }
if (killer == player) { return; }
if (info == null) { return; }
if (info.Initiator.IsNpc) { return; }
if (player.IsNpc) { return; }
if (killer.IsNpc) { return; }
if (info.Initiator.creatorEntity) { return; }
if ((clanplayer == clanKiller) && !player.IsAdmin) { sendAdminMsg("Clan Kill", $"{killer.displayName} has killed <color=##8ff442>{player.displayName}</color>!"); log("clan_kill", $"Clan: [{clanKiller.ToString()}] [{killer.displayName} ({killer.userID})] killed [{player.displayName} ({player.userID})]", false); return; }
PrintToChat($"<color=#1aff1a>{killer.displayName}</color> ({Math.Round(info.InitiatorPlayer.health, 1)} HP) -> <color=#ff3333>{player.displayName}</color>\n<size=13>{item.info.displayName.english} | <color=#1aff1a>{Math.Round(info.ProjectileDistance, 2)}</color>m | {info.boneName}</size>");
PrintToChat(player, $"You were killed by <color=#1aff1a>{killer.displayName}</color>[<color=#1aff1a>{Math.Round(info.InitiatorPlayer.health, 1)}</color> HP] from <color=#1aff1a>{Math.Round(info.ProjectileDistance, 2)}</color>m using <color=#1aff1a>{item.info.displayName.english}</color> in the <color=#1aff1a>{info.boneName}</color>.");
} Failed to call hook 'OnPlayerDie' on plugin 'ParadiseRust v1.0.0' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.ParadiseRust.OnPlayerDie (BasePlayer player, HitInfo info) [0x00013] in <c4e54f04cbaa4f6e87ddc0ec57aed3cf>:0
at Oxide.Plugins.ParadiseRust.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0135a] in <c4e54f04cbaa4f6e87ddc0ec57aed3cf>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0