i think you just create a pointer , and play with distance like that :

Code:
ENTITY* cam_pointer;
var dist = 500;
VECTOR temp;
action camera_place ()
{
	set(me,INVISIBLE);

	while(1)
	{
		if(player)
		{
			var result_trace = c_trace(player.x,my.x,IGNORE_ME|IGNORE_PASSABLE);	
			if(!result_trace)
			{						
				if(vec_dist(my.x, player.x) < dist)
				{
					cam_pointer = me;					
				}
			}			
		}
		wait(1);
	}
}

function camera_fun() // in loop
{
	if (cam_pointer)	
	{
		vec_set(camera.x,cam_pointer.x);
		vec_set(temp,player.x); 
		vec_sub(temp,camera.x);
		vec_to_angle(camera.pan,temp); 
	}
}



test and source code : https://www.mediafire.com/?2xr433i5ijbrr1k

hope this work great for you laugh
Sorry i thought this a question laugh

Last edited by Dico; 06/07/17 12:16.