It's possible to assist teammates in melee from range. When I started out I was accidentally killing teammates in melee. Then I learned to pop shots at melee engaged enemies. Don't spray and pray your guns at the enemy. You may get the kill or not but you also get xp for the assist so it's worth it. One issue is with melee players not knowing their role. I've seen so many just blast into an area that's being hit by gunfire.