1. 1. There is a player.
    2. There are necessary coordinates (this is not a position player).

    Question: How can I find out if the player can build in the given coordinates?
     
  2. Wulf

    Wulf Community Admin

    I don't know of any way to check that. Basically a player flag gets set when a player is in an area they can build in, which is what CanBuild checks.
     
  3. Romzes, are you referring to the hook or the CanBuild inside BasePlayer?
     
  4. If my house is in a strange area of construction, I want to ban the teleport to the location.
    To do this, it would be nice to come up with how to determine whether a Can Build player in certain coordinates.
     
  5. The server doesn't calculate everything, because not everything is practical for vanilla Rust. There's no reason why vanilla Rust would have to determine whether a player can build somewhere before entering it, so there's no built in way of doing that, and you'll have to come up with a way by yourself through reading the decompiled Rust source code.
    The same goes for your other post Solved - IsWalk() player method? | Oxide.
    To get you started:
    The BuildingPrivilidge flag is set like this:
    Code:
    // BasePlayer
    private void UpdatePrivilegeFlags()
    {
        BuildingPrivlidge buildingPrivlidge = this.GetBuildingPrivilege();
        this.SetPlayerFlag(BasePlayer.PlayerFlags.InBuildingPrivilege, buildingPrivlidge);
        this.SetPlayerFlag(BasePlayer.PlayerFlags.HasBuildingPrivilege, buildingPrivlidge && buildingPrivlidge.IsAuthed(this));
    }
    BasePlayer.GetBuildingPrivilidge looks like this:
    Code:
    // BasePlayer
    public BuildingPrivlidge GetBuildingPrivilege()
    {
        uint num = 4294967295u;
        BuildingPrivlidge result = null;
        for (int i = 0; i < this.buildingPrivilege.Count; i++)
        {
            BuildingPrivlidge buildingPrivlidge = this.buildingPrivilege[i];
            uint num2 = (buildingPrivlidge.net != null) ? buildingPrivlidge.net.ID : 0u;
            if (num2 < num)
            {
                if (buildingPrivlidge.CheckEntity(this))
                {
                    result = buildingPrivlidge;
                    num = num2;
                }
            }
        }
        return result;
    }