Well actually I used your code just for the 3rd person
view if you don't mind.
But do you mind that I can explain my problem to you

Well I have got the player to moce his pan with the mouse force x but the mouse
force y can control the up and down movement, this is the code:
Code:
var temptilt = 0;
temptilt += 5 * mouse_force.y * time; //mouse to look up and down
player.pan -= 20 * mouse_force.x * time; //using the mouse to turn left and right
camera.z=player.z+100;
camera.tilt=-10;
camera.pan = player.pan;
camera.x = player.x - 300 * cos (player.pan) + ;
camera.y = player.y - 300 * sin (player.pan) + ;
Any suggestions ??