There are a few possibilities associated with the pain you are having in your right leg and from your description it is difficult to ascertain exactly where the symptoms are occurring from. For this reason, it is best if you are evaluated by your primary care doctor
who can assess your presenting symptoms and clinical exam and decide upon the appropriate work up.
This may include imaging studies and possibly a referral to a specialist. The potential causes of severe right leg pain can be anywhere from the nerves that exit the spine in your low back being compressed and causing shooting type pains, to damage in your hips, knees or ankles. Have you noticed any swelling, redness, or pain anywhere along your right leg? Have you had any decreased range of motion or tenderness to palpation anywhere along your leg? These are things to check for prior to going to your doctor.
It is possible that playing basketball has caused you some trauma that is causing this pain, and so it may be advisable to avoid playing basketball until you know what the cause of this pain is. Rest, antiinflammatory medications (NSAIDs) and muscle relaxants may be helpful during this time as well.