Hey All,
Getting some random problem that has me at a loss. Code is below.
Code:void OnEntityTakeDamage(BaseEntity entity, HitInfo info) { if (entity is BasePlayer) { RespawnGodTimer(entity.ToPlayer(), info); } }Code:private void RespawnGodTimer(BasePlayer player, HitInfo hitinfo) { if(player.lifeStory == null) return; if(player.lifeStory.secondsAlive < 2) { CancelDamage(hitinfo); } }![]()
![]()
Any help would be appreciated here...
Solved BasePlayer does not contain a definition for lifeStory (private)
Discussion in 'Rust Development' started by pinkstink, Dec 18, 2017.
-
Wulf Community Admin
It is private, so you’d need to use reflection.
-
My god... how the hell did I miss that............. *facepalm*... thanks haha
-
Perhaps it'd also be a better idea to scroll through the source, rather then an IL viewer?
Oxide has a GitHub repo where you can find all the things you need, without the need for an extra tool. -
More importantly what would help is if I opened by eyes and saw the private flag... haha -
// EDIT: I just now noticed you're checking out BasePlayer (Fail) For that you'll need some IL viewer, indeed.Just one issue, BasePlayer is not part of Oxide, but it's part of RUST. To be public in Oxide there would be need for some trickery.
Last edited by a moderator: Dec 20, 2017 -
Wulf Community Admin