Are you familiar with the distance formula?
If not Google it and familiarize yourself with it, it's quite useful.
You don't really need to understand it in your case though.
PHP Code:
function hit(x, y, radius) {
for (temp.pl : findNearestPlayers(x, y)) {
if (dist(x, y, pl.x, pl.y) <= radius) {
pl.trigger("hit");
}
}
}
function dist(x1, y1, x2, y2) {
return (((x2 - x1) ^ 2) + ((y2 - y1) ^ 2))) ^ 0.5;
}