Smup pump broke and water leaked on to the carpet
Rent a carpet shampooer and suck up as much of the water as you can, then shampoo carpet, set a fan in the room until carpet dries.
When I moved into this house and my old house they both had REAL BAD pet smell. To get rid of it I poured a good bit of baking powder on the floor everynight. In the morning I would vaccum it up. I did that everyday for like 3 weeks. It worked for animal smell,maybe for your problem.
Get new carpet. You can try Microban products, which kills mildew and definately helps eliminate smells, but its rather expensixe, and if you had much water at all, may not be worth the cost. Get a little extra insurance the next time, they will cover basement leaks if you get a rather inexpensive rider for it (Ive got it for mine).
Use Fabbreeze in your carpet cleaner. Or some type of bio smell attacker. You want something that elemantes oders. But put the product if liquid in the carpet cleaner. and make sure you have a carpet cleaner not exstractor. The exstractor will only pull water out of your carpet where as a cleaner will clean the carpet and pull the water. You may have to pull the carpet up to let the pad under dry then spray the pad with your desmelling product. hope this helps.
Have you tried calling your insurance company? It is really hard to get that out of a carpet and the bacteria that may be growing can be dangerous especially if you have allergies. If you do call them make sure to ask like it's a hypothetical question. You know, act like you've been shopping around a little more and you wanted to know if you have coverage for that situation and what it would cost to get that kind of coverage etc. If you have no insurance you might want to just get an estimate from a professional cleaning company. The ones that specialize in flood or fire damage clean up. If you are truly desperate and have very little to spend you could try some oxy-clean. Mix up a couple of gallons of it. Spray it over the carpet until you've saturated the whole area including the mat underneath and then leave it for about one hour. Then use a commercial cleaning machine(the kind you rent from a store) to suck up as much of the water as possible. Put a fan on the carpet and turn either your air conditioner or heat on because that will help dehumidify the area and make it dry up faster. After it's all nicely dried (aproximately 1 to 2 days). Sprinkle the carpeting with a powdered carpet odor remover and vaccuum it up after a few minutes. Oxy clean does kill mildew which is the culprit in most carpet smells. Oxy clean can remove some of the color from your carpet but not like bleach does! I haven't had it lighten anything of mine but that is the warning on the package! My daughter likes to play with water on her carpet in her bedroom (much to my dismay!) The oxyclean and carpet deodorizer work well at getting rid of that horrible smell.