Hey, I wanted a plugin like this one (AutomaticAuthorization for Rust | Oxide) does, but instead of typing the command, it will authorize automatically when the cupboard is placed.
Thanks.
Rust Automatic cupboard authorization for self
Discussion in 'Plugin Requests' started by T SpooN, Mar 19, 2017.
-
I wonder if this will work ?? I cooked it up, but unable to test atm.
Moderator edit: removed broken code. If sharing full plugins, please test and use the Plugins section once usable.Last edited by a moderator: Mar 21, 2017 -
Wulf Community Admin
-
Last edited by a moderator: Mar 21, 2017
-
Essentially this would be a good way to start.
Code:private void OnEntitySpawned(BaseNetworkable ent) { if (ent is BuildingPrivlidge) { BuildingPrivlidge priv = (ent as BuildingPrivlidge); BasePlayer pl = BasePlayer.FindById(priv.OwnerId); priv.authorizedPlayers.Add(new ProtoBuf.PlayerNameID { userid = pl.userID, username = pl.displayName, ShouldPool = true }); priv.SendNetworkUpdateImmediate(); } }
-
I was close lol, not :/
I didn't know onEntitySpawn was when something was placed. -