here

Code:
function main()
{
        video_mode = 7;
	shadow_stencil = 1;
	sound_vol = 100;
	set(pSplash,VISIBLE);
	wait(3);
	level_load("farm.hmp");
	ent_createlayer("skylayer.tga", SKY | CUBE | VISIBLE, 0);
	wait(-1); 
	pan_remove(pSplash); 
	ent_create("character.mdl", vector(25,55,45), main_player);
}



ignore that after testing something it seems to be this code that gives the error

Code:
action main_player() //control the player
{    
  var walk_percentage = 0;
  while (1) 
  {
    my.pan += (key_a - key_d)*5*time_step;   //rotate the entity using [A],[D]
    var distance = (key_w - key_s)*5*time_step;
    c_move(me, vector(distance,0,0), NULL, GLIDE); //move it using [W],[S]
    walk_percentage += distance;
    ent_animate(me, "walk", walk_percentage, ANM_CYCLE); //animate the entity
    wait (1);
  }
}



edit3: found the problem its to do with this
Code:
c_move(me, vector(distance,0,0), NULL, GLIDE);



Last edited by JakeBilbe; 05/16/11 00:35.