The Martin County Sheriff's Office posted images of the exchange -- which landed 29-year-old William Lamberson in handcuffs -- to Facebook on September 10.
When Lamberson first allegedly texted the captain, who heads the Martin County Sheriff's Narcotics Unit, the captain asked "Who is this?"
But the mistake became clear when Lamberson allegedly texted, "Wanna smoke so bad u have any green (sic)."
The captain then began to play along, and after some more texting back and forth, Lamberson allegedly offered to sell him cocaine.
They agreed to meet at a pool hall. When Lamberson arrived, he was greeted by the captain, who promptly placed him under arrest. He was charged with possession of a controlled substance with the intent to sell.