Sports and other vigorous activities can cause excessive fluid loss from perspiration. These cramps are more likely to occur in warm weather and can be an early sign of heat stroke. Sodium depletion has also been associated with cramps. Loss of sodium, the most abundant chemical constituent of body fluids outside the cell, is usually a function of dehydration.
Low blood calcium, magnesium: Low blood levels of either calcium or magnesium directly increase the excitability of both the nerve endings and the muscles they stimulate. Cramps are seen in any circumstance that decreases the availability of calcium or magnesium in body fluids, such as taking diuretics, hyperventilation (overbreathing), excessive vomiting, inadequate calcium and/or magnesium in the diet, inadequate calcium absorption due to vitamin D deficiency, poor function of the parathyroid glands (tiny glands in the neck that regulate calcium balance), and other conditions.
Source : medicinenet.com
It is always better to consult a physician before you take any medication or action.