Constraining the cosmological parameters with the gas mass fraction in local and $\mathsf{{\vec z}>0.7}$ galaxy clusters