I'm 30 weeks pregnant and k broke my lest ankle and now I need surgery, I also got x-rays done on my foot, how can all this affect my baby?

Baby should be fine. You should be able to have all of the tests and treatment you need without any impact on the baby.
Probabley no affect. If proper protocols where used and lead shielding was placed over your abdomen you run a minimal risk of any problems to you or the baby. The areas that you describe would have a minimal area of x-ray exposure and there is very little scatter (radiation not going to the intended area) radiation.
Affect. As stated - this should have no effect. Sorry about your injury.