Death Messages

Displays a server wide messages of deaths.

Total Downloads: 2,408 - First Release: May 23, 2015 - Last Update: Mar 8, 2018

5/5, 5 likes
  1. immediately after installing the plugin
    [DOUBLEPOST=1457427340][/DOUBLEPOST]
    maybe I made a mistake ?

    using System;
    using System.Collections.Generic;
    using CodeHatch.Engine.Networking;
    using CodeHatch.Networking.Events.Entities;
    using CodeHatch.Engine.Core.Cache;
    using System.Linq;
    using Oxide.Core;
    using CodeHatch.Damaging;

    namespace Oxide.Plugins
    {
    [Info("Death Messages", "PaiN", 0.4, ResourceId = 1042)]
    [Description("Displays a server wide message showing who killed who")]
    class DeathMessages : ReignOfKingsPlugin
    {
    private List<string>DamageT = new List<string>{"Slash","Bash","Pierce","Projectile"};

    void OnEntityDeath(EntityDeathEvent e)
    {
    if(e.Entity == null || e.KillingDamage.DamageSource == null || e == null || e.Entity.IsPlayer == false || e.KillingDamage.DamageSource.Owner.IsServer || e.Entity.Owner.IsServer) return;
    foreach(string dmgt in DamageT)
    if(e.KillingDamage.DamageTypes.ToString() == dmgt)
    PrintToChat($"[0083FF]{e.KillingDamage.DamageSource.Owner.DisplayName} [EE0000]killed[0083FF] {e.Entity.Owner.DisplayName}[FFFFFF]");
    }

    }
    }
    [DOUBLEPOST=1457643849,1457426846][/DOUBLEPOST]Up
     
  2. Right now i cant check it.. just redownload the plugin and put it into oxide/plugins
     
  3. Not work. ;(
     
  4. Today or tomorrow I will try to test this plugin and if its broken I will fix it.
     
  5. When can we expect a fix?
     
  6. I will need someone to test with.
    I just started downloading the server so if you want to help add me on steam Steam Community :: PaiN
     
  7. There are some results? If not, i'll add you in steam during the day.
     
  8. Well add me and I will tell you when the tests will happen.
     
  9. Have these issues been dealt with yet? Not fun having my logs fill up with this.
     
  10. I will try to fix that but I will need to find out what is null and when and how...
     
  11. I think, either the game, or oxide had some changes in the last updates.

    Almost all older plugins who revolve around death (eg Bountytracker) throw a null in certain cases (for most plugins this would be lethal impact/falling damage).
    J

    edit:

    and come to think of that:
    when a "e.Damage.DamageSourceOwner" is declared, i think it always will throw an exception at OnEntityHealthChange when it comes to falling, because there is no "real" DamageSource (because Terrain is no Entity) and no DamageSourceOwner (because the Terrain is not even owned by the server)

    just a logical conclusion, could as well be total rubbish.

    I'm gonna try that out.

    j



    edit 2:
    So my conclusion:

    I tested the above and was successful.

    If any of your plugins use:
    OnEntityHealthChange
    or
    OnEntityDeath

    and declare a "DamageSource"
    (for OnEntityHealthChange it is e.Damage.DamageSource, for OnEntityDeath it is e.KillingDamage.DamageSource)
    and/or a respective "Owner"

    you should add the following null checks:
    Code:
     if (damageEvent.Damage.DamageSource == null || damageEvent.Damage.DamageSource.Owner == null)
                {
                    return;
                }

    Code:
    if (deathEvent.KillingDamage.DamageSource == null || deathEvent.KillingDamage.DamageSource.Owner == null)
      {
      return;
      }
    regards

    J
     
    Last edited by a moderator: Jul 25, 2016
  12. Thanks for that, worked on my server. Had to update the NoFriendFire plugins as well.
     
  13. The first two are not correct :p(did you try to compile ?) and the second ones I already check for them but you just added .Owner at the end.
     
  14. PaiN updated Death Messages with a new update entry:

    0.5

     
  15. for all my plugins, this works perfect

    if it does for you, too: glad i could help.
    if it does not: Sorry I am not a programmer :p
     
  16. 14:52 [Error] Failed to call hook 'OnEntityDeath' on plugin 'DeathMessages v0.5.0' (NullReferenceException: Object reference not set to an instance of an object)
    14:52 [Debug] at Oxide.Plugins.DeathMessages.OnEntityDeath (CodeHatch.Networking.Events.Entities.EntityDeathEvent e) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.DeathMessages.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 name, System.Object[] args) [0x00000] in <filename unknown>:0
     
  17. Is there anyone alive ?
     
  18. Nope, I think we are all dead. What do you want?
     
  19. You forgot the death message :p
     
  20. "PaiN died in while trying to fix this plugin."