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?
Solved Getting BasePlayer in CanUseLockedEntity?
Discussion in 'Rust Development' started by Goofie, Aug 6, 2017.
-
Wulf Community Admin
You'd have to use one of the FindPlayer methods to get the player if only the user ID is available.
-
Thanks,
var door_owner = rust.FindPlayerById(LockedDoor.OwnerID) as BasePlayer;
Correct? -
Wulf Community Admin
-
Weird, OwnerID seems to be 0.
-
Wulf Community Admin
-
-
Wulf Community Admin
-
-
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.
-
Found it, LockedDoor.parentEntity.Get(true).OwnerID