Is there any way to show UI "Building blocked" notification?
I tried to change building privilege but it seems not working at all.
Code:player.SetPlayerFlag(BasePlayer.PlayerFlags.HasBuildingPrivilege, false); player.SetPlayerFlag(BasePlayer.PlayerFlags.InBuildingPrivilege, false);// just in case MethodInfo info = player.GetType().GetMethod("UpdatePrivilegeFlags", BindingFlags.NonPublic | BindingFlags.Instance); info.Invoke(player, null);
Solved Show "Building blocked" notification
Discussion in 'Rust Development' started by deer_SWAG, Jul 22, 2016.
-
Wulf Community Admin
Take a look at my MasterKey plugin.
-
If you mean this
then that's what I am trying to do. Idk why but nothing works.Code:timer.Once(0.1f, () => player.SetPlayerFlag(BasePlayer.PlayerFlags.HasBuildingPrivilege, true));
-
Wulf Community Admin
Ah right, that'd just set it.. not sure how to actually send the notification, I just send a chat message. -
To actually have a player being building blocked (including notification on the bottom right) the player needs to be in an actual `BuildingPrivlidge` zone.
-
That what i thought.
-
Or try this, this example toggles your "UI Blocked"

Code:[ChatCommand("block")] void cmdBlock(BasePlayer player, string cmd, string[] args) { if (player.HasPlayerFlag(BasePlayer.PlayerFlags.InBuildingPrivilege)) player.SetPlayerFlag(BasePlayer.PlayerFlags.InBuildingPrivilege, false); else player.SetPlayerFlag(BasePlayer.PlayerFlags.InBuildingPrivilege, true); } -
hmmm.. why it isn't worked for me then..Code:
player.SetPlayerFlag(BasePlayer.PlayerFlags.HasBuildingPrivilege, false);
-
its the difference between the two

InBuildingPrivilege = general set in triggerzone > this flag is always set in ANY cupboard-range
HasBuildingPrivilege = will be true, when you are authed on the cup which triggers you. -
Yes. I know that
