function bullet()
{
.........

while(me)
{
c_move(me,vector(40,0,0),nullvector,USE_BOX|IGNORE_MODELS);
c_scan(me.x,me.pan,vector(360,0,200),SCAN_ENTS|IGNORE_FLAG2|IGNORE_ME);
if (result<5)
{
if(is(you,FLAG2)==1){return;}
ent_remove(me);
}
wait(1);
}
}

and also the player and the gun have Flag2 set, but the engine crashes. Can you correct it if you find mistake in the code pls