If the carpet stinks, then you should replace it.
You should be aware that the urine from all mammals will fluoresce under ultraviolet light, and janitorial service companies use UV lights made especially for this purpose to find old animal urine stains and clean them.
Bane-Clene® Ultra-Violet Black Light Pet Urine Detector
But, if your old carpet has all kinds of old urine stains, you might be best off to replace it.
In my opinion, the very best kind of carpet you can buy is a commercial solution dyed nylon carpet. "Solution dyed" means that the carpet gets it's colour from tiny coloured particles (called "pigments") added to the molten nylon before it's drawn into a fiber. So, the coloured particles are suspended inside the fiber very much like the raisins in raisin bread.
Nylon is the strongest fiber used to make carpet from. Over 80 percent of the commercial carpet made is made from nylon fiber. And, almost all commercial carpet is level loop because of the natural resiliency of a loop of fiber. So, nylon level loop carpets are the longest wearing carpets you can buy.
And, because solution dyed nylon level loop carpet gets it's colour from pigments encased in the nylon plastic, you can use bleach straight out of the jug on such a carpet without concern that you'll harm the carpet. That's because there will be a film of nylon plastic between the bleach and the source of the colour. So, you can use bleach straight out of the jug to remove otherwise impossible stains from solutoin dyed nylon carpets without harming the carpet.
I own a small apartment block, and I install level loop solution dyed nylon carpets in my apartments. If you're interested, go to any carpet retailer and ask to see their solution dyed nylon carpets. I install Shaw "Franchise" in the "Starry Night" (colour #10405).
Any 100% Olefin carpet will also be solution dyed and therefore immune to bleach as well, but Olefin isn't as strong a fiber and just won't last as long as nylon.
PS: The "experts" at carpet stores will tell you that you're crazy to use bleach on any carpet. Nod your head and pretend to agree. Then, pay $2 for one of those door mat size carpet samples made of either solution dyed nylon or any 100% Olefin carpet, take it home and torture it with bleach. You'll find that the bleach won't harm it. I've tossed out lots of carpets that have been badly cigarette burned or stained or otherwise damaged, but I've never seen bleach harm either one of the two kinds of carpets mentioned, and I've never thrown out a carpet because it was damaged by bleach.