Is there a way to AddXP to a player if he is offline and dead?
Code:getplayersomehow.xp.Add(Rust.Xp.Definitions.Cheat, xp);
Adding XP to offline and non-sleeper player?
Discussion in 'Rust Development' started by Reynostrum, Jul 12, 2016.
-
As far as I know, it's not possible to get the player when they're disconnected without a sleeper.
-
Wulf Community Admin
orCode:var agent = BasePlayer.FindXpAgent(id) agent.xp.Add(Rust.Xp.Definitions.Cheat, 123f);
orCode:var agent = ServerMgr.Xp.GetAgent(id); agent.xp.Add(Rust.Xp.Definitions.Cheat, 123f);
Code:Rust.Xp.Add(Rust.Xp.Definitions.Cheat, 123f, null, id)
-
Wulf almighty

And is there a way to get the baseplayer on the same situation? -
Wulf Community Admin
There is no BasePlayer if they aren't online. -
Could you not do:
Code:foreach(var player in BasePlayer.activeSleeperList) { //Do Stuff } -
Wulf Community Admin
If they're sleeping, sure, but the OP was looking for non-sleepers aka dead I guess. -
Ooooooh ok. You had said:
There is no BasePlayer if they aren't online. So I was confused.
-
Wulf Community Admin
Well, in a way there isn't, but I could have worded that better I guess.
