Police saw smoke coming from the inside of a vehicle in Castlerock at 1am on Friday May 4 this year and when they approached they could smell cannabis.
There were four people in the vehicle and two of the occupants – Nicholas Esler (26), of Rockview Park, Rasharkin, and Jonathan Law (23), of Murob Park, Ballymena – admitted possessing cannabis.
At Coleraine Magistrates Court on Monday June 18 they were both ordered to do 75 hours of unpaid work.
A prosecutor said an item was thrown from the car and Esler admitted he had been smoking it.
Esler told the police he had £120 worth of cannabis and that he was self-medicating.
Further cannabis was found during a search of Esler’s home.
Defence barrister Michael Smyth previously said the drugs were for the defendants’ personal use and there was no suggestion of supply.
At Monday’s Court, District Judge Nigel Broderick told the men: “If you continue to use drugs you are going to come back to court and each time you come back the penalties will get heavier”.