Check out the post I just made in the Landlord forum (Have you ever seen this? Smoker damage)
You have to clean the walls first to get rid of as much of the nicotine as possible. This includes ceilings, behind outlet covers and light switches, etc. Once it's clean, paint the walls with an oil-based Kilz primer. Nicotine will "bleed" through normal paint over time. After you put the primer on, then you can paint.
I tried painting over a smokers walls once and it bled right through. I had to scrub the walls with TSP (trisodium phosphate) then, Kilz, then paint. Was a side job years ago. Didn't make much on that one...