Hello there, your game runs smoothly in Single Player and Online mode due to the fact that the base GTA V game is properly optimized without additions. However, for RAGEMP and its substitutes, they are alternative multiplayer platforms which means modifications, added interiors, scripts and so on are utilized to provide a dedicated experience.
This can cause issues to players with Medium to Low-End PCs, and even High-Ends in some cases based on the graphics settings set (reducing the settings to gain more FPS may cause hardware bottlenecks in some cases). Can you provide the specs that you have currently? Also are you playing at 1080p or a higher resolution? What graphics settings do you have set up for the game?