If you have two ranged PCs, one happens to be a Rogue, can the Rogue get sneak attack and flanking? Diagram to follow:
PC = other PC
M = monster
x = feet
Is this still flanking? and if that is the case, the Rogue would get sneak attack from ranged as long as the rogue was within 30' correct? Note there is no one in melee with the monster.
Is there a limit to this? Do both PCs have to be within the 30' or just the Rogue?
When making a melee attack, you get a +2 flanking bonus if your opponent is threatened by another enemy character or creature on its opposite border or opposite corner.
When in doubt about whether two characters flank an opponent in the middle, trace an imaginary line between the two attackers' centers. If the line passes through opposite borders of the opponent's space (including corners of those borders), then the opponent is flanked.
Exception: If a flanker takes up more than 1 square, it gets the flanking bonus if any square it occupies counts for flanking.
Only a creature or character that threatens the defender can help an attacker get a flanking bonus.
Creatures with a reach of 0 feet can't flank an opponent.
Just so you know all the basics of flanking. Your rulebook will have a nice picture of how it all works out in the combat chapter too.
But remember that the rogue can get sneak attack with a ranged attack if:
(a) the target is denied dexterity bonus to AC and
(b) the rogue is within 30' of the target.
I have successfully used stealth to hide and shoot from concealment. I have also used sneak attack against flat-footed opponents with a ranged attack.