1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  1. Rebajas

    Rebajas Wood Hoarder

    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 (Text):
    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.

  2. FuJiCuRa

    FuJiCuRa Plugin Developer

    Code (Text):
  3. Rebajas

    Rebajas Wood Hoarder

    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. k1lly0u

    k1lly0u Plugin Developer

    Code (C#):
    void OnEntityDeath(BaseCombatEntity entity, HitInfo info)
       var player = entity.ToPlayer();
       if (player != null)
          // Do Stuff