Dear friend, welcome to HCM.
You seem to be in great pain.
Did you land on your leg with your weight on it?
If you can not bear your weight, can not straighten the leg at the knee and not getting better with rest, you should see your doctor to rule out any severe injury
e.g. to your joint discs (meniscii) or ligaments.
These are more severe than a simple muscle sprain
which should not cause such severe restriction .
You can take paracetamol
for pain till then, keep the leg rested on a hard surface and if possible immobilise it with a cloth.
You may need an Xray.
I think I could help you out.
Thanks and keep me posted.