The Flintstones Season 5 Episode 21
While hunting out west for uranium, Fred and Barney manage to get themselves appointed sheriff and deputy in a town terrorized by an outlaw band. They (and the town) are saved through the intervention of the famous television western family, the Cartrocks, westerners from the Rockerosa.