This only goes for the movies. In the books they have arranged a house for Frodo on the eastern border of the Shire, where he will go lay low for several months before going to Rivendell. Merry, Pippin and Fatty Bolger have figured out the plan months in advance and made their own plans, in such a way that when the black riders arrive in the region, they leave within 5 minutes and have a route planned out already.
Also, it's tobacco as clearly mentioned in the books. They are probably quite drunk in this scene though.
Edit: and of course Samwise was also involved in the plans, he was the one who told them. Frodo was being played by all his close friends.