Why it sending me error? (it's sending me when i dying from fall or another, but it's sending it not always) Error:
Failed to call hook 'OnPlayerDeath' on plugin 'MedkitSaver v1.0.0' (NullReferenceException: Object reference not set to an instance of an object
My code:
Failed to call hook 'OnPlayerDeath' on plugin 'MedkitSaver v1.0.0' (NullReferenceException: Object reference not set to an instance of an object
My code:
object OnPlayerDeath(BasePlayer player, HitInfo info)
{
if(player.IsConnected && steamIDs.Contains(player?.IPlayer?.Id?.ToString()))
{
DestroyMedkitUi(player);
steamIDs = steamIDs.Replace(player?.IPlayer?.Id?.ToString(), string.Empty);
}
return null;
}