1. 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);
                }
            }
    upload_2017-12-18_9-29-27.png

    upload_2017-12-18_9-29-2.png

    Any help would be appreciated here...
     
  2. Wulf

    Wulf Community Admin

    It is private, so you’d need to use reflection.
     
  3. My god... how the hell did I miss that............. *facepalm*... thanks haha
     
  4. 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. :)
     
  5. Maybe so, but a decompiler will provide easy and quick links to a field/methods class without the need to troll through multiple files.

    More importantly what would help is if I opened by eyes and saw the private flag... haha
     
  6. I admit that for the game's files (Mainly UI, BasePlayer and BaseCombatEnity) I sometimes peek with ILSpy, but for Oxide I just grabbed a local clone of the repo and opened it with VS CE 2017, I am able to just click through everything with the trusty-old [Ctrl] + [Lmb] :)

    True on that, indeed... :p

    // EDIT: I just now noticed you're checking out BasePlayer (Fail) For that you'll need some IL viewer, indeed. :p 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
  7. Wulf

    Wulf Community Admin

    Anything such as BasePlayer is something the game provides, so it wouldn't be something you can just clone from our repo. You'd also not be able to view private methods like the one mentioned in this thread in Visual Studio's IntelliSense either because of it being private. The option to make it public would be something we would handle via our patcher, which we already do for numerous other fields and methods.