i've found this code there where you recommnded me but it has some mistakes aparently... there are error messages like "var undeclared identifier"
void plyr()
{
var cam_angle = 0; // set the initial camera angle here
var zoom = 200;
VECTOR temp;
set(my,TRANSLUCENT);
my.alpha = 100;
while(1)
{
wait(1);
zoom += 2 * (key_pgup - key_pgdn) * time_step;
dist_to_wall = c_trace(camera.x,my.x,IGNORE_ME|IGNORE_PASSABLE);
if(dist_to_wall != 0)
{
tempZoom = 10;
}
else
{
tempZoom = 0;
}
cam_height += 3 * (key_cuu - key_cud) * time_step;
cam_height = clamp(cam_height, 50, 300);
zoom += 2 * (key_pgup - key_pgdn - tempZoom) * time_step;
zoom = clamp(zoom, 20, 500);
my.alpha = zoom;
my.alpha = clamp(my.alpha,10,100);
camera.x = my.x - zoom * cos(cam_angle);
camera.y = my.y - zoom * sin(cam_angle);
camera.z = my.z + cam_height;
cam_angle += 5 * (key_cur - key_cul) * time_step; // 5 gives the camera rotation speed
vec_set(temp.x, my.x);
vec_sub(temp.x, camera.x);
vec_to_angle(camera.pan, temp); // rotate the camera towards the player at all times
my.x += key_w - key_s;
my.y += key_a - key_d;
}
}
void main()
{
fps_max = 60;
video_mode = 6; // 6=640x480 7=800*600 8=1024x768 9=1280x960
video_depth = 16; // 16 bit colour D3D mode
video_switch(0,0,2); // 1 = Full Screen 2 = window
tex_share = 1; // when set to on all entities share their textures saving memory
level_load("test.wmb"); //load the level
}