I have to agree with Superku...

And even though I shouldn't do this...
Here's your code:

Code:
action players_code() // attach this action to your player model in all the levels
{
	var movement_speed = 10; // movement speed
	
	VECTOR temp;
	
	set(me, INVISIBLE); // 1st person player
	player = me; // I'm the player
	
	// this section recreates the flashlight (if needed)
	if (got_flashlight == 1) // the flashlight was picked up in a previous level?
	{
		flashlight = ent_create("lantern.mdl", player.x, move_flashlight); // the recreate it!
	}
	
	// end of the section that recreates the flashlight (if needed)
	while (1)
	{
		my.pan -= mickey.x * time_step;
		
		//
		
		camera.x = my.x;
		camera.y = my.y;
		camera.z = my.z + 50 + 1.1 * sin(my.skill44); // play with 50 and 1.1
		
		camera.pan = my.pan;
		camera.tilt -= mickey.y * time_step;
		camera.tilt = clamp(camera.tilt, -90, 90); // keep angle beetween -90° and 90°
		
		//
		
		vec_set(temp.x, my.x); // trace 10,000 quants below the player
		
		temp.z -= 10000;
		temp.z = -c_trace(my.x, temp.x, IGNORE_ME | IGNORE_PASSABLE | USE_BOX) - 2; // play with 2
		temp.x = movement_speed * (key_w - key_s) * time_step;
		temp.y = movement_speed * (key_a - key_d) * 0.6 * time_step;
		
		c_move(my, temp.x, nullvector, IGNORE_PASSABLE | GLIDE);
		
		wait (1);
	}
}


I've replaced mouse_force with mickey, since mouse_force is clamped to a range of [-1 ... 1]
Also I'm using clamp to keep tilt between -90 and 90 degrees.

But please do us all the favor and try to understand what it's doing, NOW.

If you have trouble understanding it, please ask but don't think I'm going to write more stuff for you.

Last edited by Kartoffel; 03/08/14 15:29. Reason: typos everywhere

POTATO-MAN saves the day! - Random