Hallo,

I had modify the surveillance_camera_code from aum10. When the player stand in front of a monitor and press the action_key, switchs to the camaraview. (The goes fine) But i have some problems.
1) I can't swicht between cameras. ( I will switch between all cameras in the level. And from the last cameraview to the playerview.)
2) Player can move when the cameraview is on (The player should not be able to move, but can be nevertheless killed if the Camaraview is on.)

Code:
  
var cam_var = 0;

view surv_camera {}


function change_var()
{

if (key_ctrl == 1) // wird STRG gedrückt
{
if (cam_var == 1)
{
cam_var = 2;
}
if (cam_var == 2)
{
cam_var = 0;
}
}
}




action camera_switch
{
my.enable_click=ON;
my.enable_scan = ON;
//MY.enable_shoot = ON;
MY.event = camera_event;
}

function camera_event
{
cam_var=1;
}


action cam_1 // Action der 1 Camera
{
while(1)
{

if (cam_var == 1)
{
my.skill8=1;
surveillance_camera();
}
else
{
my.skill8=0;
}
wait(1);
}
}

action cam_2 // Action der 2 Camera
{
while(1)
{

if (cam_var == 2)
{
my.skill8=1;
surveillance_camera();
}
else
{
my.skill8=0;
}
wait(1);
}
}



function surveillance_camera
{

if (my.skill1 + my.skill2 + my.skill3 + my.skill4 + my.skill5 + my.skill6 == 0) {beep; beep; return;}
// remove the camera if we forget to fill in the skills 1..6 (at least one of them)


while (1)
{
if (my.skill8 == 1) //
{

camera.visible = off; // hide the default "camera"
surv_camera.x = my.skill1; // set the new camera position and angles
surv_camera.y = my.skill2;
surv_camera.z = my.skill3;
surv_camera.pan = my.skill4;
surv_camera.tilt = my.skill5;
surv_camera.roll = my.skill6;
surv_camera.visible = on; // and make it visible

cam1_pan.visible = on;
change_var();
}
else
{
if (cam_var == 0) // now it has lost the focus and shouldn't affect the other surveillance cameras
{
surv_camera.visible = off;
camera.visible = on;
cam1_pan.visible = off;
cam2_pan.visible = off;

}
}
wait (1);
}

}





By White_Wolf

P.S. sorry for my bad englich


A8 Com Version 8.40 Win 7 64 Bit