My apartment had smokers living in it before I got here. When I would shower, the humidity would make like yellow tar leach out of the walls. Just disgusting. Stop smoking people.
Carpet shampoo. Febreeze. Scrub the walls if you can. Keep windows open when you can. It just takes time. I've heard applying baking soda to carpets and then vacuuming after a few days works, but no way am I going to trust any vacuum to get all that crap out of my carpet.