Classical spin models with discrete or continuous degrees of freedom arise in many studies of complex physical systems. A wide class of hard real-life optimization problems can be formulated as a minimization of a spin Hamiltonian. Here we show how to simulate the discrete Ising and n-state planar Potts models with or without external fields using the physical gain-dissipative platforms with continuous phases, such as lasers and various nonequilibrium Bose-Einstein condensates. The underlying operational principle originates from a combination of resonant and nonresonant pumping. Our results lay grounds for the physical simulations of a broad range of Hamiltonians with complex interactions that can vary in time and space and with combined symmetries.