Try to write
proc_mode = PROC_EARLY;
in your elevator loop.
If that does not help, check when the player is on the elevator (that means inside the elevator's bounding box, above it and vertically close to it) and change his z-position accordingly. Example:
my.z += direction*time_step;
if(player on elevator) player.z += direction*time_step;