The Takoma Park City Council approved an amendment to the city's nuclear-free-zone law last night that will allow the city to do business with companies associated with the production of nuclear weapons if none other can be found to provide a particular product or service.

The 5-to-2 vote, with members Lynne E. Bradley and Herman Williams dissenting, came in the face of strong opposition from Mayor Sammie A. Abbott and a number of city residents and caps six months of bitter debate among council members.

Supporters of the amendment argued that the ordinance should be changed because of the broad range of companies the city had previously done business with that are in some way involved in the nuclear weapons industry.

However, a majority of about 100 city residents at the meeting opposed the waiver provision, saying it would weaken the ordinance. Some residents who testified contended the vote was a step backwards from the council's stand taken more than a year ago when it decided to prohibit involvement with nuclear weapons producers.

"We smell a rat. This is an attempt to weaken the ordinance passed over a year ago," said resident Mike Davidson.

The amendment follows the city's solicitation last spring of bids for badly needed police radio equipment. Only General Electric and Motorola, both contractors on missile projects, responded.

While the city has been able to find a radio manufacturer not involved in the production of nuclear arms, supporters of the waiver provision said it will help to avoid similar problems in buying other items, such as cars, for the city.