Has anyone had this?

Has anyone had horrible leg pain and cramps during the night. It makes it so hard to sleep. Were you pregnant when you get them?