Angles are notoriously difficult to work with in my experience, but you can try this:
Have two instance variables on the pirate ship called "AngleToPlayer" and "DistanceToPlayer"
Use the following events:
E.) System: Every Tick: A.) PirateShip: Set Value: AngleToPlayer: "angle(self.x, self.y, player.x, player.y)": A.) Set Value: DistanceToPlayer: "distance(self.x, self.y, player.x, player.y)"
E.) PirateShip: Compare Instance Variable: DistanceToPlayer is less than X: A.) PirateShip: Rotate Towards Angle: "Self.AngleToPlayer + 90"
Sub E.) PirateShip: Is Within Angle: 5 degrees of "self.AngleToPlayer + 90": A.) Insert whatever event you need to make the ship fire.
Note that this makes it so that the ships always fire from one side. You can use the event "is clockwise from angle: self.AngleToPlayer +90" and the inversion of that same event to help you make the pirate ships to turn one way or another. You'll have to change +90 to -90 in some of the earlier events, and +270 if the angle from the pirate ship to the player is less than 90 degrees and you want to fire at the player from the right side of the ship.