Well here are my trying code so far. Piced it together by looking and studying other type of code.

My problem is now:
The player moves towards the place I clicked with the mouse, but it dont stop there.
How do I make the player stop at the point I click with the mouse?

Code:
VECTOR temp;
function point_mouse()
{

  
  temp.x = mouse_pos.x;
  temp.y = mouse_pos.y;
  temp.z = 200;
  vec_for_screen(temp,camera);
c_trace(camera.x,temp,IGNORE_ME);
  		if(hit.x != NULL)
  		vec_set(my.x,hit.x);
  		wait(1);
}


action player_mouseAct(){
	c_setminmax(me);
	var variabel_1 = 1;
	VECTOR temp; vec_zero(temp);
	ANGLE my_angle; vec_zero(my_angle);
	while(1){
		
		if(mouse_left==1){
			variabel_1 = 0;
			vec_set(temp,mouse_pos.x);
			vec_sub(temp,my.x);
			vec_to_angle(my_angle,temp);
			my.pan = my_angle.pan;
			vec_set(temp,mouse_pos.x);
			temp.z = my.z;
		}
		if(variabel_1 == 0){
			if(vec_dist(my.x,temp)<=1) 
			variabel_1 = 1;
			c_move(me,vector(10*time_step,0,0),nullvector,IGNORE_ME|GLIDE|IGNORE_PASSABLE);
		}
		wait(1);
	}
}


Last edited by Eagelina; 06/01/09 13:07.

A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile