It is not an easy task to remove pets wee smell from your carpet and may prove to be almost impossible, one should not have expectation to this smell going away completely. However said that I can be certain that situation can be improved with some home remedies, like mentioned in previous posts, you can use vinegar and baking soda. Those should be used in right mixture and make sure not to over-soak the carpet as this will cause so many more problems then previously. On top of all that I would recommend to try finding reason why your pet would be watering your carpet, this could have some reasons with in your control.
Now to different solution: using dettol to combat smell from your beloved pet can be very effective. You want to use antibacterial to combat any smell that bacteria are causing, however you have to be aware that smell is caused by ammonia in the wee that is main cause of smell and may be very difficult to remove from carpet because of its chemical nature.
Solution with dettol should be implemented to carpet to the level of mild wetness, after application make sure to dry the carpet with either kitchen towels or with baking soda that will combat smell and bacteria, dettol also helps with smell.
At the end one should be patient with this sort of problem and try this solution multiple times to get most out of those surfaces that could be affected.