The incident happened at around 5pm on Main Street near New York Avenue.
One woman's vehicle was hit as she drove by Town Hall.
A second car was also struck.
No one was injured in the shootings.
Police responded to the scene and shut down the area.
There were four people, three men, and a 20-month-old baby in the apartment where the shots were fired from.
After a brief standoff, three of the adults, including the shooter, voluntarily surrendered.
"First person to come out. He was intoxicated. Resisted a little bit. We had to use a taser. But he was taken into custody. He's being treated at the hospital and will be taken to a precinct," said Inspector James Rhodes, of the Suffolk County Police Department.
Cops went in and arrested the fourth.
"We got a call somewhere around 5pm that a vehicle had its window shot out. We got down here, there was another vehicle with its window shot out. There was a Smithtown Parks Officer down here who saw somebody shooting from this apt back here. We secured the scene, shut down the street, secured the perimeter in order to keep anyone else from getting hurt and we attempted to get everyone out of the house. We managed to talk three people out of the house then went in and got the last one," Rhodes said.
It's not known why the man started shooting at the vehicles.
"Emergency service did a good job. They were the ones who went into the apartment. They found three weapons, rifles," Rhodes said.