Quote:

Code:
 function change_camara_number
{
if (key_ctrl == 1) // wird STRG gedrückt
{





if you doing this this way it must to be inside loop

it's not working because you changing in this case camera from 0->1 1->2 2->0 in one cycle !!! so nothing will happend
Code:
 
function change_camara_number
{
if (camara_number == 0)
{
camara_number = 1; //0 -> 1 start from 0
}
if (camara_number == 1)
{
camara_number = 2; //1 -> 2
}
if (camara_number == 2)
{
camara_number = 0; //2 -> 0 end with 0
}
}
on_ctrl change_camara_number;




so better will be if You'll do it this way:
Code:
 
function change_camera
{
camera %= 3; // this is "modulo", parameter will only have value 0,1,2 (write "ugly" in help serch and you'll find this in "ugly code") ;)
camera_number += 1;
}
on_ctrl change_camera;


then...
Code:

function surveillance_camera
{
while(1)
{
if(camera_number ==1).....
if(camera_number ==2)....
wait(1)
}
}


and you have to call this function only once... f.e. in player action to avoid empty pointers.

and cut-off change_camara_number();!! in this function becouse it doesn't make sense to do it in every cycle

Last edited by tompo; 06/06/07 10:30.

Never say never.