/// <summary> /// Checks if a given player has permission to build in the region /// </summary> /// <param name="ply">Player to check permissions with</param> /// <returns>Whether the player has permission</returns> public bool HasPermissionToBuildInRegion(TSPlayer ply) { if (!DisableBuild) { return(true); } if (!ply.IsLoggedIn) { if (!ply.HasBeenNaggedAboutLoggingIn) { ply.SendMessage("You must be logged in to take advantage of protected regions.", Color.Red); ply.HasBeenNaggedAboutLoggingIn = true; } return(false); } return(ply.HasPermission(Permissions.editregion) || AllowedIDs.Contains(ply.Account.ID) || AllowedGroups.Contains(ply.Group.Name) || Owner == ply.Account.Name); }
/// <summary> /// Checks if a given player has permission to build in the region /// </summary> /// <param name="ply">Player to check permissions with</param> /// <returns>Whether the player has permission</returns> public bool HasPermissionToBuildInRegion(TSPlayer ply) { if (!DisableBuild) { return(true); } if (!ply.IsLoggedIn) { if (!ply.HasBeenNaggedAboutLoggingIn) { ply.SendMessage("登录后才能使用此被保护的区域.", Color.Red); ply.HasBeenNaggedAboutLoggingIn = true; } return(false); } return(ply.HasPermission(Permissions.editregion) || AllowedIDs.Contains(ply.User.ID) || AllowedGroups.Contains(ply.Group.Name) || Owner == ply.User.Name); }