1. Hello,

    I am trying to find BasePlayer from LockedDoor, I tried to use

    var door_owner = LockedDoor.OwnerID as BasePlayer; but it can't convert ulong to BasePlayer.

    And I also tried LockedDoor.ToPlayer() as BasePlayer but it gets a null result

    Any help? :)
     
  2. Wulf

    Wulf Community Admin

    You'd have to use one of the FindPlayer methods to get the player if only the user ID is available.
     
  3. Thanks,
    var door_owner = rust.FindPlayerById(LockedDoor.OwnerID) as BasePlayer;
    Correct?
     
  4. Wulf

    Wulf Community Admin

    That'd be an older method from Oxide, but there are BasePlayer.FindPlayer methods as well from Rust as well as some newer ones.
     
  5. Weird, OwnerID seems to be 0.
     
  6. Wulf

    Wulf Community Admin

    If it has no owner, it'd be 0. Doors haven't had owners since... probably a couple months ago.
     
  7. Do you know any other method to return who owns the codelock etc?
     
  8. Wulf

    Wulf Community Admin

    I'm not sure they store owners anymore either.
     
  9. Ah nevermind I will just reverse engineer it :), thanks anyway :)
     
  10. Wulf

    Wulf Community Admin

    You'd likely have to store who placed them in a file if Rust doesn't track owners for those anymore. I know doors for sure don't, locks likely too.
     
  11. Found it, LockedDoor.parentEntity.Get(true).OwnerID