It does not count dead players because dead players cannot carry anything. But you can get distance to a dropped object from a FLAGRETURN goal.
foreach(g in Util.GoalTable("FLAGRETURN.*"))
{
d = DistanceBetween(g, Vec3(-1824, 2115, 4));
Util.MapDebugPrint("Distance " + d);
}
voilegarde_b3.gm
That's my solution. Not the cleanest solution but from my testing it works. For checking if the doors are opening and eventually opened I use "rightlabdoor_button_Moving".
Check Right_Lab_Door_Moving2 to see what I did there.