var dist_to_wall = 0;
var tempZoom = 0;
void plyr()
{
var cam_height;
var cam_angle = 0; // set the initial camera angle here, thiet lap goc quay camera
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);// Khoang cach toi buc tuong, c_trace gui 1 tia tu vi tri nay
//toi vi tri kia vĂ  kiem tra tia nay co dung chuong ngai vat tren duong no chieu hay ko

if(dist_to_wall != 0)
{
tempZoom = 10;
}
else
{
tempZoom = 0;
}

cam_height += 3 * (key_cuu - key_cud) * time_step; // thiet lap do cao cua camera
cam_height = clamp(cam_height, 50, 300);

zoom += 2 * (key_pgup - key_pgdn - tempZoom) * time_step;// zoom camera
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.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 , xoay camara

//temp.x=my.x;// cai nay ko the thay the cho vec_set vi 1 ly do nao do
vec_set(temp.x, my.x);
//temp.x-=camera.x; cai nay ko the thay the cho vec_sub vi 1 ly do nao do
vec_sub(temp.x, camera.x);// temp.x=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;// di chuyen nhan vat
my.y += key_a - key_d;// di chuyen nhan vat
}
}

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
}


This code finished but I dont know why he used void function and didn't use action function. I had tried to use action function but camera didn't active. Who can explain ??