Gyroresonance radiation produced by proton and electron beams in different regions of the magnetosphere