With my clairvoyant skills I see that you put Nebel(); before the level_load() function ^^ Why do I know this? Because I guess that the engine crashes because the player pointer is invalid (this means that the player is not created yet).

So improve your function a bit:
Code:
function Nebel()
{

   while (1) 
   {

     if(player != NULL)
     {
         if (player.z<0)
         {
            camera.fog_start=100;
            fog_color=2;
            camera.fog_end=1000;
         }
         else
         {
            fog_color=0; 
         }
      }
      wait(1);
   }
}




ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version