As Pakistani rioters roamed the streets of Islamabad, an American tourist couple emerged from their hotel in the downtown section. Sensing history in the making, the couple struggled to get out camera gear to record the scene before them. Not far away the American Embassy was ablaze and under attack by rioters.

The mob swirled around the tourist couple, engulfing them before they could run to the relative safety of their hotel lobby. Cameras, watches, jewelry and other valuables were stripped from the couple, but they avoided serious injury.

Like a score of other American tourists that day, and like many American tourists around the world recently, the couple were victims of increasing civil disorder abroad.

Civil unrest still ranks well behind drug-related incidents as a cause of trouble for Americans traveling abroad. But many Americans have reported cases of harassment, intimidation, robbery and extortion in countries beset by internal unrest.

The State Department maintains a special Citizens Emergency Center to cope with such problems. In the worst cases, the center helps cooordinate evacuation from countries where conditions become dangerous. In recent months, Americans have been airlifted from Pakistan, Nicaragua and Iran after riots or revolutions.

To prevent such extreme measures, the State Department makes the following recommendations to travelers.

First, check with the nearest passport office to determine if a travel advisory has been issued for the country to be visited. The advisory will describe the conditions deemed not suitable for travel, varying from civil disorders and natural disasters to overbooking of hotel space.

The State Department, for example, recommended against travel to Yugoslavia during the state funeral of Marshall Tito because hotels were filled with visiting dignitaries.

Currently there are 13 nations for which travel advisories -- they have no binding power -- have been issued on grounds of civil unrest: Iraq, Lebanon, Syria, Kuwait, Libya, Afghanistan, Iran, Pakistan, El Salvador, Chad, Uganda, Liberia and Cuba.

There also is a "limited" advisory on Zimbabwe-Rhodesia warning travelers not to venture outside major cities in case some guerrilla bands have not heard of the peace settlement.

Second, the State Department advises that all Americans who plan to be inside a country for any length of time register with the American Embassy. Then, in case of trouble, they can be contacted and informed of conditions.

"Americans are always the last ones to realize things are getting hairy," said a State Department spokesman. "Americans often get swept up in civil disorders simply because they wait until the last minute to leave."

Third, use common sense. If you emerge from your hotel to find a mob in the streets, go back in the hotel. Many foreign travelers have noted that Americans in particular seem to feel invulnerable. They are not.

Fourth, if trouble strikes, contact the nearest U.S. Embassy or consulate. Problems ranging from emergency funds to air evacuation are arranged by U.S. posts abroad. Americans have a right to be received promptly by an American consular office. But do not expect help with such problems as routine check cashing, entertainment or free legal services.

The main problem encountered by Amricans involves drugs, not riots. In 1979, nearly half of all arrests of Americans abroad involved drug-related incidents. The actual figure was 49 percent of 5,501 arrests.

Of those drug arrests, 54 percent were arrests for possession of less than an ounce of marijuana. The State Department this year will continue its advertising campaign to inform Americans of the hazards of Drug use abroad. Officials say there still is too little awareness of the severity of penalties in foreign countries.

Mexico, for example, has a mandatory seven-year sentence with no bail or parole for simple possession. Individuals convicted of having more than three ounces of marijuana are considered traffickers in Turkey, Thailand, Taiwan, Singapore, Iraq, Algeria and Iran. The maximum penalty for trafficking is death.

Most incidents involving Americans in civil unrest have had less grievous consequences. But the State Department warned that serious situations can occur.

It was feared that the American rescue attempt in Iran this spring might trigger a reaction against the approximately 300 Americans visiting Iran, mainly journalists and spouses of Iranian citizens. Several thousand Americans have remained in Liberia despite the recent coup. Many of those have been subjected to "shakedowns," according to State Department officials.

"We cannot force people to leave; they have to make their own decisions," the State Department spokesman said.