The actual programmed version of it probably wouldn't be any more efficient than a scripted version. Either way, it's only doing simple checks.
PHP Code:
function findAreaPlayers(tx, ty, tw, th) {
for(temp.pl: players) {
if(temp.pl.x in |tx,tx+tw| && temp.pl.y in |ty,ty+th|) {
temp.plarray.add(temp.pl);
}
}
return temp.plarray;
}
or something like that.