I fixed it, after comparing code I had before to the code I wrote up today I managed to fix some bits, although I cant seem to animate it because of the way I have made him move. Could someone clean this code up for me a little bit and make him use the animations run, stand and jump on space and also make it so that he stands on the map and not go through it?

Code:
action main_player() //control the player
{
while (1) //wait 1
{
if (key_a)
my.pan += 19*time_step; //if key A is pressed turn left
if (key_d)
my.pan -= 19*time_step;//if key D is pressed turn right
if (key_w)
c_move (my, vector(12 * time_step, 0, 0), nullvector, GLIDE); //if key W is pressed go forward
         
if (key_space) me.z +=8; //if space is pressed jump
if (me.z > 20) me.z -=0.4; //if the player is above z.20 then glide down at 0.4 speed
wait (1);

		camera.x = my.x+100; // camera location behind the player
      camera.y = my.y;    // camera left/right placement
      camera.z = my.z+50; // camera height
      camera.tilt = -25;  // make it look downwards
      wait (1);
}
}