Hii..
If you have severe pain then painkillers will act only for a short period of time..and it will not stop until u take proper treatment of the tooth..( most probably if cavities are there u need to do root canal treatment )
Next Steps
get your consultation done asap and take treatment and medications accordingly..
Health Tips
Don't forget to tell the medical history of conditions u have to the dentist before treatment ..