Solved Player metabolism values

Discussion in 'Rust Development' started by NobodyFTW, Feb 5, 2015.

  1. Hi,

    How can I get the player's metabolism values, and even change them if possible?

    Thanks in advance,

    SkinN!
     
  2. Wulf

    Wulf Community Admin

    Dig into the Assembly-CSharp.dll and look for them. The Metabolism Control plugin did have them, but they may have changed in a recent Rust update.
     
  3. I'm afraid I don't know how to.
     
  4. Wulf

    Wulf Community Admin

    Use a program such as JustDecompile or dotPeek, open the file and search for metabolism.
     
  5. I just found out what I need:
    Code:
    -- target = BasePlayer of a playertarget.metabolism.calories.value
    target.metabolism.hydration.value
    target.metabolism.poison.value
    target.metabolism.radiation.value
    target.metabolism.oxygen.value
    target.metabolism.bleeding.value
    target.metabolism.wetness.value
    target.metabolism.dirtyness.value
    target.metabolism.health.value
    
    Code:
    -- We can simply change these values:
    target.metabolism.calories.value = 1
    -- or get them:
    if target.metabolism.radiation.value then
      -- code
    end
    
     
  6. hmm... I'm trying to get health value but without success, but bleeding. calories, heratrate work. I'm confused...

    Code:
               var player = entity as BasePlayer;
                if(player == null)
                {
                    SendMsgAdmin(string.Format("player not defined"));
                }
                else
                {
                SendMsgAdmin(string.Format("health {0} ", player.metabolism.health.value));
                SendMsgAdmin(string.Format("bleeding {0} ", player.metabolism.bleeding.value));
                SendMsgAdmin(string.Format("calories {0} ", player.metabolism.calories.value));
                SendMsgAdmin(string.Format("heartrate {0} ", player.metabolism.heartrate.value));
    
     
  7. Wulf

    Wulf Community Admin

    player.health.value
     
  8. Actually it's just player.health

    This post is a lil outdated. :)

    Code:
    player.health
    player.metabolism.heartrate.value
    player.metabolism.calories.value
    player.metabolism.hydration.value
    player.metabolism.poison.value
    player.metabolism.radiation.value
    player.metabolism.oxygen.value
    player.metabolism.temperature.value
    player.metabolism.bleeding.value
    player.metabolism.wetness.value
    player.metabolism.dirtyness.value
    
     
  9. thx, Wulf.

    Code:
    SendMsgAdmin(string.Format("health {0} ", player.health));
    did work.