4 months pregnant, right flank pain, cannot pee much, please help?

Stone/ infection. Probably either a small stone and/or infection....Reccomend seeing your ob/gyn asap for his evaluation/ testing/ treatment.
Get checked out. You may have a ureteral stone causing pain and frequency of urination, but it is important to be checked for UTI as well, as this could be dangerous to your pregnancy (with or without a stone).