FUNCTIONAL APPROACH TO (2+1)-DIMENSIONAL GRAVITY COUPLED TO PARTICLES