It's an older machine, sounds like your psu may be failing due to age. If you're happy with the machine, see if you can swap out the power supply, even temporarily. If you want to do some serious gaming, it might be a good time to save up for a new PC.