Well first of all you have to use a loop on all the players online.
Example:
fromPoz = {x = 1622, y = 1253, y = 7}
toPoz = { x = 1635, y = 1265, y = 7}
players = getPlayersOnline()
for _, pid in ipairs(players) do
if(isInArea(getPlayerPosition(pid), fromPoz, toPoz)) then...