I don't have hemorrhoids, but let me address this scientifically. If anal play hurts for any reason, stop. Hemorrhoids can be located at different spots in the rectum or anus and may or may not create a blockage to anal play. Some books have suggested that if there is no pain or bleeding that the "massage" of tissue from anal sex may actually improve blood flow and relaxation of the area, thus helping alleviate hemorrhoid issues. I don't know about that. I would love to learn if that is true.
Anyway, there is no one answer to this, but if those hemorrhoids are big enough or located where they bother you, please see a gastroenterologist and have them treated. It is quick and effective and there are lots of ways they can be "dealt with" so as not to be a problem.
Best of luck.