DeathNotes

Moved

Total Downloads: 66,139 - First Release: Feb 14, 2015 - Last Update: May 13, 2018

4.98519/5, 270 likes
  1. having an issue with deathnotes not displaying some players kills but sends them to the console ? anything i could do to fix this ?
     
  2. These are the relevant code blocks to:
    1. Fix helicopter death messages
    2. Add the BradleyAPC
    3. Support the scientists
    I would prefer sharing the full file as the amount of edits becomes hard to read/use when it's all within code blocks. @Wulf would it be okay if I also attached the full .cs file? PS I claim no ownership of this. All thanks goes to LaserHydra for the hard work.

    Code:
    List<DeathReason> SleepingDeaths = new List<DeathReason>
    {
    ---
    DeathReason.Helicopter,
    DeathReason.Tank,
    DeathReason.Scientist,
    DeathReason.Slash,
    ---
    };
    
    Code:
    class Attacker
    {
    public string name = string.Empty;
    [JsonIgnore]
    public BaseCombatEntity entity;
    public AttackerType type = AttackerType.Invalid;
    public float healthLeft;public string TryGetName()
    {
    if (entity == null)
    return "No Attacker";if (type == AttackerType.Player)
    return entity.ToPlayer().displayName;
    if (type == AttackerType.Scientist)
        return "Scientist";
    if (type == AttackerType.Zombie)
    return "Zombie";
    if (type == AttackerType.Helicopter)
    return "Patrol Helicopter";
    if (type == AttackerType.Tank)
    return "Bradley APC";
    if (type == AttackerType.Turret)
    return "Auto Turret";
    if (type == AttackerType.Self)
    return "themselves";
    if (type == AttackerType.Animal)
    ---
    return "No Attacker";
    }public AttackerType TryGetType()
    {
    if (entity == null)
    return AttackerType.Invalid;
    if (entity is NPCMurderer)
    return AttackerType.Zombie;
    if (entity.ToPlayer() != null && entity.ToPlayer().displayName != null)
    return AttackerType.Player;
    if (entity.ToPlayer() != null && entity.ToPlayer().displayName == null)
    return AttackerType.Scientist;
    if (entity.name.Contains("patrolhelicopter"))
    return AttackerType.Helicopter;
    if (entity.name.Contains("bradleyapc"))
    return AttackerType.Tank;
    if (entity.name.Contains("agents/"))
    return AttackerType.Animal;
    if (entity.name.Contains("barricades/") || entity.name.Contains("wall.external.high"))
    return AttackerType.Structure;
    if (entity.name.Contains("beartrap.prefab") || entity.name.Contains("landmine.prefab") || entity.name.Contains("spikes.floor.prefab"))
    return AttackerType.Trap;
    if (entity.name.Contains("autoturret_deployed.prefab"))
    return AttackerType.Turret;return AttackerType.Invalid;
    }
    }
    
    Code:
    class Victim
    {
    public string name = string.Empty;
    [JsonIgnore]
    public BaseCombatEntity entity;
    public VictimType type = VictimType.Invalid;public string TryGetName()
    {
    if (type == VictimType.Player)
    return entity.ToPlayer().displayName;
    if (type == VictimType.Scientist)
        return "Scientist";
    if (type == VictimType.Zombie)
    return "Zombie";
    if (type == VictimType.Helicopter)
    return "Patrol Helicopter";
    if (type == VictimType.Tank)
    return "Bradley APC";
    if (type == VictimType.Animal)
    {
    if (entity.name.Contains("boar"))
    return "Boar";
    if (entity.name.Contains("horse"))
    return "Horse";
    if (entity.name.Contains("wolf"))
    return "Wolf";
    if (entity.name.Contains("stag"))
    return "Stag";
    if (entity.name.Contains("chicken"))
    return "Chicken";
    if (entity.name.Contains("bear"))
    return "Bear";
    if (entity.name.Contains("zombie"))
    return "Zombie";
    }return "No Victim";
    }public VictimType TryGetType()
    {
    if (entity == null)
    return VictimType.Invalid;
    if (entity is NPCMurderer)
    return VictimType.Zombie;
    if (entity.ToPlayer() != null && entity.ToPlayer().displayName != null)
    return VictimType.Player;
    if (entity.ToPlayer() != null && entity.ToPlayer().displayName == null)
    return VictimType.Scientist;
    if (entity.name.Contains("patrolhelicopter"))
    return VictimType.Helicopter;
    if (entity.name.Contains("bradleyapc"))
    return VictimType.Tank;
    if ((bool)entity?.name?.Contains("agents/"))
    return VictimType.Animal;return VictimType.Invalid;
    }
    }
    
    Code:
    public DeathReason TryGetReason()
    {
    if (victim.type == VictimType.Helicopter)
    return DeathReason.HelicopterDeath;
    if (attacker.type == AttackerType.Helicopter)
    return DeathReason.Helicopter;
    if (victim.type == VictimType.Tank)
    return DeathReason.TankDeath;
    if (attacker.type == AttackerType.Tank && victim.type == VictimType.Scientist)
    return DeathReason.TankScientist;
    if (attacker.type == AttackerType.Tank)
    return DeathReason.Tank;
    if (attacker.type == AttackerType.Turret)
    return DeathReason.Turret;
    if (attacker.type == AttackerType.Trap)
    return DeathReason.Trap;
    if (attacker.type == AttackerType.Structure)
    return DeathReason.Structure;
    if (attacker.type == AttackerType.Animal)
    return DeathReason.Animal;
    if (victim.type == VictimType.Animal)
    return DeathReason.AnimalDeath;
    if (attacker.type == AttackerType.Zombie)
    return DeathReason.Zombie;
    if (victim.type == VictimType.Zombie)
    return DeathReason.ZombieDeath;
    if (weapon == "F1 Grenade" || weapon == "Survey Charge")
    return DeathReason.Explosion;
    if (weapon == "Flamethrower")
    return DeathReason.Flamethrower;
    if (victim.type == VictimType.Scientist)
        return DeathReason.ScientistDeath;
    if (attacker.type == AttackerType.Scientist)
        return DeathReason.Scientist;
    if (victim.type == VictimType.Player)
    return GetDeathReason(damageType);return DeathReason.Unknown;
    }
    
    Code:
    enum VictimType
    {
    Player,
    Scientist,
    Zombie,
    Helicopter,
    Tank,
    Animal,
    Invalid
    }enum AttackerType
    {
    Player,
    Scientist,
    Helicopter,
    Tank,
    Animal,
    ---
    }enum DeathReason
    {
    ---
    Tank,
    TankDeath,
    TankScientist,
    Structure,
    Trap,
    Animal,
    AnimalDeath,
    Scientist,
    ScientistDeath,
    Zombie,
    ---
    }
    
    Code:
    ---
    SetConfig("Messages", "HelicopterDeath", new List<object> { "The {victim} was taken down." });
    SetConfig("Messages", "Tank", new List<object> { "{attacker} blew a hole in {victim}'s {bodypart}." });
    SetConfig("Messages", "TankDeath", new List<object> { "{victim} was taken down." });
    SetConfig("Messages", "TankScientist", new List<object> { "{attacker} drove over a {victim}." });
    SetConfig("Messages", "Animal", new List<object> { "A {attacker} followed {victim} until it finally caught him." });
    SetConfig("Messages", "AnimalDeath", new List<object> { "{attacker} killed a {victim} with a {weapon}{attachments} from {distance}m." });
    SetConfig("Messages", "Scientist", new List<object> { "A {attacker} killed {victim} in self-defence." });
    SetConfig("Messages", "ScientistDeath", new List<object> { "A {victim} was killed by {attacker} with a {weapon}{attachments} from {distance}m." });
    SetConfig("Messages", "Zombie", new List<object> { "A {attacker} haunted down {victim}." });
    ---
    SetConfig("Messages", "Helicopter Sleeping", new List<object> { "{victim} was sleeping when he was shot to pieces by a {attacker}." });
    SetConfig("Messages", "Tank Sleeping", new List<object> { "{attacker} tried to wake up {victim}." });
    SetConfig("Messages", "Animal Sleeping", new List<object> { "{victim} was killed by a {attacker} while having a sleep." });
    SetConfig("Messages", "Scientist Sleeping", new List<object> { "A {attacker} took {victim} away for science." });
    SetConfig("Messages", "Slash Sleeping", new List<object> { "{attacker} slashed sleeping {victim} in half." });
    ---
    
    Code:
    Messages = GetConfig(new Dictionary<string, object>
    {
    // Normal
    ---
    { "HelicopterDeath", new List<object> { "The {victim} was taken down." }},
    { "Tank", new List<object> { "{attacker} blew a hole in {victim}'s {bodypart}." }},
    { "TankDeath", new List<object> { "{victim} was taken down." }},
    { "TankScientist", new List<object> { "{attacker} drove over a {victim}." }},
    { "Animal", new List<object> { "A {attacker} followed {victim} until it finally caught him." }},
    { "AnimalDeath", new List<object> { "{attacker} killed a {victim} with a {weapon}{attachments} from {distance}m." }},
    { "Scientist", new List<object> { "A {attacker} killed {victim} in self-defence." }},
    { "ScientistDeath", new List<object> { "A {victim} was killed by {attacker} with a {weapon}{attachments} from {distance}m." }},
    { "Zombie", new List<object> { "A {attacker} haunted down {victim}." }},
    ---
    // Sleeping
    ---
    { "Helicopter Sleeping", new List<object> { "{victim} was sleeping when he was shot to pieces by a {attacker}." }},
    { "Tank Sleeping", new List<object> { "{attacker} tried to wake up {victim}." }},
    { "Animal Sleeping", new List<object> { "{victim} was killed by a {attacker} while having a sleep." }},
    { "Scientist Sleeping", new List<object> { "A {attacker} took {victim} away for science." }},
    { "Slash Sleeping", new List<object> { "{attacker} slashed sleeping {victim} in half." }},
    ---
    
     

  3. Im not seeing the cs file
     
  4. Wulf

    Wulf Community Admin

    We don't allow random versions to be posted on the forums that aren't from the current maintainer(s) and/or staff. If you'd like to share a version, you may do so via PM at your own risk.
     
  5. Alright. Anyone who would like the fixed version PM me...
     
  6. i dont know if this has been asked before, but is there a way to set the font size for the chat deaths?
     
  7. @LaserHydra
    Hello, would it be possible to put all the kill notes in a separate file to use the localization system?
    "lang /en/ DeathNotes.json", (by default) (Attachments, Bodyparts, Messages, Names, Weapons)
    "lang /fr/ DeathNotes.json" ...
     
    Last edited by a moderator: Feb 18, 2018
  8. Hi
    would it be possible to fix the death messages, at the minute all deaths of NPC's (Botspawn plugin) , Zombie *green (Radtown animals) "Murderers" or "Scientists from either plugin are shown as "zombie" deaths in chat, But if you have Rust io map or RustAdmin on it shows death of actual entity IE: (12:04:03) | Railway Patrol[8195786/2383862] was killed by bear (Bear) I realise that the Botspawn plugin is still a work in progress but hope that it can be done,
     
    Last edited by a moderator: Feb 19, 2018
  9. Kills with bows are not registering for the bots. If I kill a scientist with something other than a bow it will display in the kill feed but if you use a bow it says nothing, the kill is getting logged in the console though. Any ideas what the issue could be? Bow kills on animals are showing up as well so the bow is registering.
     
  10. i want to disable the chat feed as im using popup notifications for deathnotes but when i put it to false it still shows even after i reload the plugin.
     
  11. @shinnova PM me please ?
     
  12. How do I set it so it only shows player deaths? I don't care about animals or zombies dying, I only want player deaths to show. (I run a high spawn zombie server)
     
  13. i would just take out the all the settings except the human related ones out but im not too sure if thatd work. trial and error.
     
  14. The problem with that is when an animal kills a player, that's part of the animal message.
     
  15. Not working after wipe
     
  16. Wulf

    Wulf Community Admin

    Please provide details when reporting issues.
     
  17. Sorry my bad..its working
     
  18. Pls can you add scientist? :D
     
  19. Doesn't seem to be working correctly. The death notes show up in the console but they do not display in the chat feed. Anyone else having this issue? Started after the update.
     
  20. It works fine.. I can share my Config Json file.
     

    Attached Files: