A general model for two-dimensional solids and liquids on a substrate is studied by means of Monte Carlo simulation. The results can be applied to the case of adsorbed atoms or molecules on surfaces as well as intercalated compounds. We have focused on the study of the melting of a commensurate square-root 3 X square-root 3 structure on a triangular lattice with 1/3 coverage. The evolution of the energy, order parameters, and structure factor has been followed in a wide range of temperatures and substrate-potential strengths. The phase diagram exhibits a broad transition region between the solid and liquid phase for all the cases studied. We have in particular investigated the contribution from the two-dimensional liquid to the Bragg peaks corresponding to the substrate structure. Reiter and Moss and their collaborators have demonstrated that this gives valuable information about the substrate potential. A universal dependence is found between this and the particle fluctuations around the substrate potential wells. This dependence may be useful for an experimental determination of the magnitude of the substrate potential from scattering experiments, in particular for weak potentials and large atomic mean-square displacements.