A teenager was found with 28 bags filled with cannabis stuffed down his trousers.
The 16-year-old boy, who cannot be named for legal reasons, was with James Brereton, 20, on July 22, when police officers on patrol in Heckmondwike smelt cannabis coming from a car.
Both appeared in Leeds Crown Court on Tuesday charged with possessing cannabis with intent to supply.
Officers stopped the car, which had the windows wound down, at about 3.45pm. Brereton, of Garden Field, Wyke, was the driver.
The boy, of Heckmondwike, was in the passenger seat and had a bag with £41.50 in it strapped across his chest.
He was searched and found to have two mobile phones down his trousers, along with 31.6 grams of cannabis in small plastic bags – a street value of £270.85.
Emma Downing, mitigating for both, explained that Brereton had a three-year-old daughter, had substantially reduced his cannabis use and was starting out as a mobile car valeter.
She said the 16-year-old had a history of non-compliance with youth offending teams.
Sentencing, Miss Recorder Tulk said: “This was quite clearly street dealing.”
She reprimanded the younger boy for yawning while she was speaking, adding: “You have quite frankly an appalling record for someone of your age.
“You are going to have to start taking responsibility for yourself very quickly because if you come back to court again you will be going to custody.”
He was given a 12 month youth rehabilitation order with a four month curfew and ordered to pay a £15 surcharge
Brereton was given a 12 month community order, 200 hours unpaid work and a £60 surcharge.