1. 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);
     
  2. Wulf

    Wulf Community Admin

    Take a look at my MasterKey plugin.
     
  3. If you mean this
    Code:
    timer.Once(0.1f, () => player.SetPlayerFlag(BasePlayer.PlayerFlags.HasBuildingPrivilege, true));
    then that's what I am trying to do. Idk why but nothing works.
     
  4. Wulf

    Wulf Community Admin

    Ah right, that'd just set it.. not sure how to actually send the notification, I just send a chat message.
     
  5. To actually have a player being building blocked (including notification on the bottom right) the player needs to be in an actual `BuildingPrivlidge` zone.
     
  6. That what i thought.
     
  7. 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);
            }
     
  8. Code:
    player.SetPlayerFlag(BasePlayer.PlayerFlags.HasBuildingPrivilege, false);
    hmmm.. why it isn't worked for me then..
     
  9. 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.
     
  10. Yes. I know that