1. Is there a way to AddXP to a player if he is offline and dead?

    Code:
    getplayersomehow.xp.Add(Rust.Xp.Definitions.Cheat, xp);
     
  2. As far as I know, it's not possible to get the player when they're disconnected without a sleeper.
     
  3. Wulf

    Wulf Community Admin

    Code:
    var agent = BasePlayer.FindXpAgent(id)
    agent.xp.Add(Rust.Xp.Definitions.Cheat, 123f);
    or
    Code:
    var agent = ServerMgr.Xp.GetAgent(id);
    agent.xp.Add(Rust.Xp.Definitions.Cheat, 123f);
    or
    Code:
    Rust.Xp.Add(Rust.Xp.Definitions.Cheat, 123f, null, id)
     
  4. Wulf almighty :p

    And is there a way to get the baseplayer on the same situation?
     
  5. Wulf

    Wulf Community Admin

    There is no BasePlayer if they aren't online.
     
  6. Could you not do:
    Code:
    foreach(var player in BasePlayer.activeSleeperList)
    {
    //Do Stuff
    }
     
  7. Wulf

    Wulf Community Admin

    If they're sleeping, sure, but the OP was looking for non-sleepers aka dead I guess.
     
  8. Ooooooh ok. You had said:
    There is no BasePlayer if they aren't online. So I was confused. :p
     
  9. Wulf

    Wulf Community Admin

    Well, in a way there isn't, but I could have worded that better I guess.