You can use vectorDist()
PHP Code:
vectorDist(
{player.x, player.y, player.y},
{obj.x, obj.y, obj.z}
);
Checks the distance from one object to another based on the x, y and z properties of both objects. Failing that, you can use a distance formula (search the forums).