Helo I am just starting with c-scrypting and i want to create a throwing rock function.
at the beggining entity rock is created then i set its pan and tilt the same as cameras and started to move it with reducing dist.x and dist.z. here is the code...

function naredi_entity()
{
vec_for_vertex(zac,snezak,589);
my=ent_create("kepa.mdl",zac,NULL);
wait(20);
my.pan=camera.pan;
my.tilt=camera.tilt;
k=k+1;
h=zac_h;
i=1;
while (1)
{

dist.x=h*time;
if (h>0)
{
h=h-0.15;
}
i=i+0.12;
dist.z=i*time*-1;
move_mode=ignore_passable;
camera.tilt = clamp(camera.tilt,-10,10);
camera.pan=clamp(camera.pan,-10,10);

vec_set(camera.x,vector(my.x + fcos(camera.pan,temp),my.y +
fsin(camera.pan,temp),my.z + 8 + fsin(camera.tilt,-camera_distance)));
ent_move(dist,nullvector);

wait(1);
}
}

Now my problem is when i want to throw another rock previus rock is moving to...
Please help me or direct me to a tutorial or something.

TNX