I dont get what u mean with duplicate and what ur script is supposed to do as f.i. dist_ahead is never used - but one problem lies probably here:
Code:
if(me.x < zielx1)
{
c_move(me,vector(1,0,0),vector(0,0,-dist_down),IGNORE_PASSABLE | GLIDE); // move the player
}
if(me.x > zielx1)
{
c_move(me,vector(-1,0,0),vector(0,0,-dist_down),IGNORE_PASSABLE | GLIDE); // move the player
}
lets say zielx1 is 0.5 and my.x is 0. Then the entity is moved to my.x 1 - my.x is now > zielx1, so the entity is moved back to 0 (while 'falling' twice)