The purpose of a restraining order is to allow police to arrest the restrained person when he violates the order by being near the person with the order. Your friend should know the terms of the order and comply with it. He must read the terms of the order. If he doesn't understand the order, he should contact the police for clarification. Police have a copy of the order. If he does not clarify the terms and violates the order, he runs the risk of being arrested. It doesn't matter who is at the location first. The terms of the order controls what must happen when the two people are in the same place. The judge has the authority to require whatever she thinks is necessary for the safety of the person seeking the order.
To get a restraining order, a person must present evidence that an order is required for safety. Like voice recordings, letters, specific evidence of previous disturbances, etc. At the very least, the ex probably continued contacting the women after she clearly told him that she did not him to contact her. At some point, contact becomes stalking.