The Scotland men's team have secured a place at the World Cup for the first time since 1998.