Yeah. You're actually increasing jump_height each frame, so the player is accelerating into the air, stopping abruptly, and shooting on back down. You start jump_height at 1 before the while() loop in jump(), but I'd recommend starting it high and then slowly subtracting, like FoxHound says. That's how real physics work--you push off with a given force, and then slowly you lose upward velocity to gravity, and then gravity overtakes you, and pulls you back down.
You'll have to do the math to get it to align right with my.ANIMATION, but I'd start jump_height at 10ish, and then subtract time_step (or maybe 2 or 3 * time_step) every frame.
function jump()
{
jumpheight = 10;
my.ANIMATION += 8*time_step;
ent_animate(me,"jump",my.ANIMATION,0);
while (1)
{
jumpheight -= 2*time_step;
c_move(me, vector(0,0,jumpheight), NULL, GLIDE);
if (my.ANIMATION > 50) { break;}
wait(1);
}
while (my.ANIMATION > 50)
{
// keep decreasing the velocity by same value
// that's how it works IRL
jumpheight -= 2*time_step;
c_move(me, vector(0,0,jumpheight), NULL, GLIDE);
if (jumpheight <= 0)
{
break;
jumpheight = 0;
my.ANIMATION = 0;
my.STATE = 1;
}
wait(1);
}
}