#define _movemode, skill6;
#define MY_MOVEMODE_STAY, 0;
#define MY_MOVEMODE_RUN, 1;
#define MY_MOVEMODE_PULLUP, 2;
VECTOR* my_vec_temp = {x=0; y=0; z=0;}
function my_player()
{
var v_temp = 0;
// do some initialisation here
while(1)
{
if ((my._movemode != MY_MOVEMODE_PULLUP) && (key_cuu)) // key_cuu can be replaced with other inputs
{
// first trace at the center of your player..
vec_set(my_vec_temp.x, my.x);
my_vec_temp.x += 3;
vec_rotate(my_vec_temp.x, my.pan);
you = NULL;
v_temp = c_trace(my.x, my_vec_temp.x, IGNORE_ME | IGNORE_PASSABLE);
if ((v_temp <= 3) && (v_temp > 0) && (you == NULL))
{
// second trace on shoulder height...
vec_set(my_vec_temp.x, my.x);
my_vec_temp.x += 3;
my_vec_temp.z += 5; // replace this value with the optimal shoulder height of your model
vec_rotate(my_vec_temp.x, my.pan);
you = NULL;
v_temp = c_trace(my.x, my_vec_temp.x, IGNORE_ME | IGNORE_PASSABLE);
if ((v_temp == 0) && (you == NULL))
{
my._movemode = MY_MOVEMODE_PULLUP;
}
}
}

my_player_move();
my_player_animate(); // after animation is done set in this function the my._movemode back to MY_MOVEMODE_STAY
my_camera_move();
wait(1);
}
}