VECTOR player_dist is for move the player along the x,y and z axis and distance to the ground is c_trace(vec1_from, vec1_to, IGNORE_ME|IGNORE_PASSENTS|IGNORE_PASSABLE|IGNORE_SPRITES|USE_BOX);
vec1 means vec_set(vec1_from,my.x); vec_set(vec1_to,my.x); vec1_to.z -= 500;
Ok. Are you executing a function with this vec_dist that displaces the character in z? Or are you using it directly, like: my.z = vec_dist.z; ? The later isn't a good solution, because when hitting space the player will automatically be at 5 quants above.
The reason I'm asking is that, to do the double jump, the code got to ask in what point of the jump the player is. If it's in the top of the jump AND pressing space_key then increase z speed. Something like that..
There are probably several ways to do this, but I can't think of any great solution. You could do something like this: when jumping keep checking move_to_vector.z (this is the speed in z and is constantly being decreased during the jump), when is arond 0 (move_to_vector.z<0.5 && move_to_vector.z>-0.5 , for example) it means it's close to the highest point, then check for key_space again. If space is pressed then move_to_vector = 5 (or something)
The code should look something like this: if(move_to_vector.z<0.5 && move_to_vector.z>-0.5) { if(key_space) move_to_vector.z = 5; //this is sloppy. Try to come up with a way to know if the player just hit //space. Or else he could just keep pressing space from the beginning of the //jump and still be able to double jump. }