ähhm, jetzt geht garnichts mehr. Wies oll ich denn das schießen unterbinden?

der neue code:
Code:
function schiessen()
{
	
	while(1)
	{
		
		VECTOR trace_target;
		var i = 1;
		if(mouse_left)
		{
			ammo = ammo -1;
			i = 70;
			
			vec_set(trace_target,vector(10000,0,0));
			vec_rotate(trace_target, ent_gun.pan);
			vec_add(trace_target, ent_gun.x);
			c_trace(ent_gun.x,trace_target,IGNORE_PASSABLE|ACTIVATE_SHOOT|IGNORE_CONTENT| SCAN_TEXTURE);
			if(HIT_TARGET)
			{	
				PARTICLE* p = ent_decal(you,hole,7+random(3),random(360));
				p.lifespan = 1600;
				p.material = mat_model;
				wait(0.5);
			}
			var l = 20;
			
			vec_for_vertex(temp.x ,ent_gun,8920);
			
			ENTITY* muzzle = ent_create("muzzle.tga", temp.x ,display_muzzle);
			
			
			
			
			

			camera.tilt = camera.tilt +2;




			
			snd_play(HK, 100,0);
			while(i<=100)
			{
				ent_animate(ent_gun,"shot",i,0);
				i += 20 * time_step;
				wait(1);
			}	
			
			
			
		}
		

		
		wait(1);
	}
}
function reload()
{
	while(1)
	{
		
		if (ammo == 0)
		{
			;
			ent_animate(ent_gun,"reload",nachladen,0);
			nachladen += 5 * time_step;
			//ammo = ammo +30;
		}
		wait(1);
	}

}



@JustSid: Was meinst du damit? Jetzt von der Setzung der {} ?

Tut mir echt leid, aber ich bekomme es nicht hin.

Last edited by TheShooter; 03/10/11 00:03.

Staub ist das neue Prime!!

Programming is like sex:
One mistake and you have to support it for the rest of your life.

Aktuelles Projekt: http://thisiswargame.bplaced.net/index.html

A8 Commercial *freu*