Four men from Hemel Hempstead have been sentenced at St Albans Crown Court after being being arrested by undercover police officers on a mission to stem the supply of drugs into the town.
Officers posing as drug dealers used hidden audio and video equipment to gather the evidence they needed to put them in the dock, the court heard.
And although only one of the four was sentenced to an immediate jail term, the judge warned the other three that their cards were now marked and police would be on their case if they stepped off the straight and narrow.
Ibrahian Aliaj, 32, of Medway Road, was sentenced to 20 months in prison, while the other three men in the dock were handed suspended prison sentences.
Daniel South, 34, of Sempill Road, received a 15-month jail sentence, suspended for 18 months, and was told to complete 120 hours community service.
45-year-old Paul Stanley of Iveagh Court and 50-year-old Gerald Donaldson of Fareham House were both sentenced to nine months in jail, suspended for 18 months.
Donaldson must also carry out 120 hours of unpaid work, while Stanley - who the court was told is a user of methadone and heroin - will be assessed for a drug rehabilitation course.
The four men were snared by undercover police officers between April 2012 and the start of this year.
The officers tricked the men into believing they were fellow drug suppliers, while at the same time using hidden video and audio equipment to record their illegal activity.
South was charged with three counts of supplying Class A drugs and six counts of supplying Class B drugs, while Aliaj was jailed for five offences of supplying Class A drugs.
Stanley admitted seven counts of supplying Class A drugs, one count of supplying Class B drugs and one count of being concerned in the supply of Class B drugs, and Donaldson was sentenced for one count of supplying Class A drugs, one count of being concerned in the supply of Class A drugs, four counts of supplying Class B drugs and one count of being concerned in the supply of Class B drugs.
As well as the drug offences, Stanley and Donaldson were both charged with handling stolen goods after revealing a stash of unlawfully-gained electrical items to one of the undercover officers.
After Aliaj was taken down to the cells Judge John Plumstead said to South, Donaldson and Stanley: “You probably think that you have got away with it today.
“But you must now realise that every police officer in the Hemel Hempstead area knows what you have done and will be looking out for you.”