VECTOR temp;
var distance_to_ground;
function gravitation()
{
while(me != NULL)
{
while(freeze_time == 1){wait(1);} ///// F R E E Z E //////
if((my.leben > 0)&&(vec_dist(my.x, player_head_ent.x) < 1000)&&(my.respawn != 1)&&(my.verhalten != GETRAGEN)&&(my.verhalten != GEWORFEN))
{
if(my.typ == BAD_GUY || my.typ == POOR_GUY) c_ignore(10,0);
vec_set (temp, my.x);
temp.z -= 100;
distance_to_ground = c_trace (my.x, temp3.x, IGNORE_ME | USE_BOX | IGNORE_PASSABLE | IGNORE_FLAG2 | ACTIVATE_SHOOT);
distance_to_ground = maxv(distance_to_ground,!trace_hit*300);
if((distance_to_ground < 10)&&(my.speed_z <= 0))
{
my.z -= distance_to_ground-1;
my.speed_z = 0;
my.skill51 = 0;
}
else
{
my.speed_z -=3*time_step;
my.speed_z = maxv(my.speed_z,-20);
my.skill51 = 1;
}
if(my.speed_x >= my.max_speed){my.speed_x = my.max_speed;}
if(my.speed_x <= -my.max_speed){my.speed_x = -my.max_speed;}
}
wait(1);
}
}