-- Startup
function InitGame(levelTime, randomSeed, restart)
	game.Print("Lua Level Init...");
	game.Print("-map_restart ...");
		game.Print("--workaround-setup ...");
			ent = entity.Spawn();
			ent:SetKeyValue("classname", "target_levelchange");
			ent:SetKeyValue("targetname", "map_restart");
			ent:SetKeyValue("target", "dn2");
			entity.CallSpawn(ent);
		game.Print("--trigger-setup ...");
		if restart == 1 then
			game.ClientPrint(-1, "Please don't use map_restart, use map or devmap instead.");
			game.Print("Please don't use map_restart, use map or devmap instead.");
			ent = entity.Find("map_restart")
			entity.Use(ent)
		end 
	game.Print("-door setup ...");
		game.Print("--set up port doors ...");
			ent = entity.FindBModel(28);
			ent:SetKeyValue("angle", "0");
			ent:SetKeyValue("wait", "-1");
			ent:SetKeyValue("speed", "25");
			ent:SetKeyValue("count", "40");
			ent:SetKeyValue("spawnflags", "4");
			entity.CallSpawn(ent);  
			entity.Use(ent); 
			ent = entity.FindBModel(29);
			ent:SetKeyValue("angle", "0");
			ent:SetKeyValue("wait", "-1");
			ent:SetKeyValue("speed", "25");
			ent:SetKeyValue("count", "32");
			ent:SetKeyValue("spawnflags", "4");
			entity.CallSpawn(ent);    
			entity.Use(ent); 
			ent = entity.FindBModel(30);
			ent:SetKeyValue("angle", "180");
			ent:SetKeyValue("wait", "-1");
			ent:SetKeyValue("speed", "25");
			ent:SetKeyValue("count", "40");
			ent:SetKeyValue("spawnflags", "4");
			entity.CallSpawn(ent);  
			entity.Use(ent); 
			ent = entity.FindBModel(31);
			ent:SetKeyValue("angle", "180");
			ent:SetKeyValue("wait", "-1");
			ent:SetKeyValue("speed", "25");
			ent:SetKeyValue("count", "32");
			ent:SetKeyValue("spawnflags", "4");
			entity.CallSpawn(ent);    
			entity.Use(ent); 
		game.Print("--set up stbd doors ...");
			ent = entity.FindBModel(32);
			ent:SetKeyValue("angle", "0");
			ent:SetKeyValue("wait", "-1");
			ent:SetKeyValue("speed", "25");
			ent:SetKeyValue("count", "40");
			ent:SetKeyValue("spawnflags", "4");
			entity.CallSpawn(ent);  
			entity.Use(ent); 
			ent = entity.FindBModel(33);
			ent:SetKeyValue("angle", "0");
			ent:SetKeyValue("wait", "-1");
			ent:SetKeyValue("speed", "25");
			ent:SetKeyValue("count", "32");
			ent:SetKeyValue("spawnflags", "4");
			entity.CallSpawn(ent);    
			entity.Use(ent); 
			ent = entity.FindBModel(34);
			ent:SetKeyValue("angle", "180");
			ent:SetKeyValue("wait", "-1");
			ent:SetKeyValue("speed", "25");
			ent:SetKeyValue("count", "40");
			ent:SetKeyValue("spawnflags", "4");
			entity.CallSpawn(ent);  
			entity.Use(ent); 
			ent = entity.FindBModel(35);
			ent:SetKeyValue("angle", "180");
			ent:SetKeyValue("wait", "-1");
			ent:SetKeyValue("speed", "25");
			ent:SetKeyValue("count", "32");
			ent:SetKeyValue("spawnflags", "4");
			entity.CallSpawn(ent);    
			entity.Use(ent);
		game.Print("--set start doors ...");
			ent = entity.FindBModel(24);
			ent:SetKeyValue("angle", "0");
			ent:SetKeyValue("wait", "-1");
			ent:SetKeyValue("speed", "25");
			ent:SetKeyValue("count", "40");
			ent:SetKeyValue("spawnflags", "4");
			entity.CallSpawn(ent);  
			entity.Use(ent); 
			ent = entity.FindBModel(25);
			ent:SetKeyValue("angle", "0");
			ent:SetKeyValue("wait", "-1");
			ent:SetKeyValue("speed", "25");
			ent:SetKeyValue("count", "32");
			ent:SetKeyValue("spawnflags", "4");
			entity.CallSpawn(ent);    
			entity.Use(ent); 
			ent = entity.FindBModel(26);
			ent:SetKeyValue("angle", "180");
			ent:SetKeyValue("wait", "-1");
			ent:SetKeyValue("speed", "25");
			ent:SetKeyValue("count", "40");
			ent:SetKeyValue("spawnflags", "4");
			entity.CallSpawn(ent);  
			entity.Use(ent); 
			ent = entity.FindBModel(27);
			ent:SetKeyValue("angle", "180");
			ent:SetKeyValue("wait", "-1");
			ent:SetKeyValue("speed", "25");
			ent:SetKeyValue("count", "32");
			ent:SetKeyValue("spawnflags", "4");
			entity.CallSpawn(ent);    
			entity.Use(ent);  
	game.Print("-Setting up spawnpoints...");
		ent = entity.FindBModel(23); 
		mover.SetPosition(ent, -946, 92, 1234);
		ent = entity.Spawn(); 
		entity.RemoveSpawns();
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "info_player_deathmatch");
		mover.SetPosition(ent, -950, 0, 1260); 
		mover.SetAngles(ent, 0, 270, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "info_player_deathmatch");
		mover.SetPosition(ent, -982, 32, 1260);  
		mover.SetAngles(ent, 0, 270, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "info_player_deathmatch");
		mover.SetPosition(ent, -982, -32, 1260); 
		mover.SetAngles(ent, 0, 270, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "info_player_deathmatch");
		mover.SetPosition(ent, -918, 32, 1260);  
		mover.SetAngles(ent, 0, 270, 0);
		entity.CallSpawn(ent);
		ent = entity.Spawn();
		ent:SetKeyValue("classname", "info_player_deathmatch");
		mover.SetPosition(ent, -918, -32, 1260); 
		mover.SetAngles(ent, 0, 270, 0);
		entity.CallSpawn(ent);
	game.Print("-Setting up viewscreen..."); 
		ent = entity.FindBModel(3); 
		ent:SetKeyValue("classname", "func_static");
		entity.CallSpawn(ent);
game.Print("...Done");
end 