PC shuts down when playing game.

Check in advanced options, PC Properties, errors and recovery if minidumps are being created.

If still no minidumps in that folder, it is likely a Hardware error for sure.

Try with other power supply.

I hate this problems. When you try something and you thing you've fixed the problem, woo, it reboots again, lowering your peace of mind.