1. Title says it all, I'm looking to detect how a player has died, specifically of environmental conditions e.g. cold, hunger, heat, radiation etc

    I found this in another plugin, but I'm not really sure how to use it:
    Code:
    info.damageTypes.GetMajorityDamageType()
    I tried writing the contents to the console but I'm guessing it's an object because I just got an error.

    Thanks in advance.


    Tony.
     
  2. Code:
    info.damageTypes.GetMajorityDamageType().ToString()
     
  3. Thanks - that worked a treat.

    I notice that OnPlayerDie triggers when the player is wounded in Rust. Is there a way to detect that the player has actually died?

    So just now a player was attacked by a bear and was wounded, OnPlayerDie was triggered - then when they actually died it was triggered again.
     
  4. Code:
    void OnEntityDeath(BaseCombatEntity entity, HitInfo info)
    {
       var player = entity.ToPlayer();
       if (player != null)
       {
          // Do Stuff
       }
    }