I have been trying to gwt pregnant for three years with no luck and found out I have a mask on my pituitary gland. Can I still get pregnant?

Yes, but get treated. Bunny, yes, you could still get pregnant, although it is much less likely. The majority of pituitary tumors secrete prolactin, which is a substance that causes lactation and inhibits (but does not prevent) fertility. This is why some people think you cannot get pregant while you are breastfeeding. While pregnancy is still possible, it is less likely.
Do you mean "mass"? If you mean a mass on your pituitary, it may be a benign adenoma secreting a hormone called prolactin which can cause weight gain, irregular periods and infertility. Treatment with medication is most common, surgery rarely needed anymore. Rx can return things to normal and restore fertility. You need an endocrinologist, neurosurgeon and eye dr appts.