To evolve Magmar into Magmortar, you need to trade it while it's holding a Magmarizer. Simply give Magmar the Magmarizer item and then trade it to another player — once the trade completes, it will evolve.
So the key is that Magmar evolves by trading, not by leveling up, and it specifically needs the Magmarizer to make the evolution happen.