{
	saved_NumObjectives [11]
	saved_CurObjective [0]

	saved_alert1_stop [0]
	saved_alert2_stop [0]
	saved_alert34_stop [0]
	saved_alert56_stop [0]
	saved_bombzone [0]

	saved_fleepath_2_enable [0]
	saved_fleepath_3_enable [0]
	saved_fleepath_4_enable [0]
	saved_fleepath_5_enable [0]
	saved_fleepath_6_enable [0]

	saved_incarenable [0]

	saved_waypoint_active [1]

	saved_FirstTime [0]
	saved_levelloaded [0]
	
	saved_playklaxxon [0]
	saved_playcar [0]
	
	saved_player_hasshot [0]
	saved_listening_forshot [0]

	Init[()
	{
		
		GetPlayer().SetInvulnerable(false);
		player = GetPlayer();
		player.SetNationality(2);

		if(saved_FirstTime = 0)
		{
			saved_FirstTime = 1;

			player = GetPlayer();
			player.GiveWeapon(47, 8);
			player.GiveWeapon(40, 5);
			player.GiveWeapon(46, 5);

			AddObjective( 146, 6926, 16824);
			SetObjectiveActive(0, true);

			AddObjective( 146, 14476, 22617);
			SetObjectiveActive(1, false);

			AddObjective( 147, 13209, 21280 );
			SetObjectiveActive(2, false);

			AddObjective( 148, 16640, 25616);
			SetObjectiveActive(3, false);

			AddObjective( 148, 20304, 27904);
			SetObjectiveActive(4, false);

			AddObjective( 148, 20048, 22944);
			SetObjectiveActive(5, false);

			AddObjective( 148, 17552, 19040);
			SetObjectiveActive(6, false);

			AddObjective( 148, 19312, 14576);
			SetObjectiveActive(7, false);

			AddObjective( 148, 17152, 8435);
			SetObjectiveActive(8, false);

			AddObjective( 149, 17920, 6387);
			SetObjectiveActive(9, false);

			AddObjective( 150, 28784, 29584);
			SetObjectiveActive(10, false);

			AutoSave();
		}
	}]
	
	OnLevelLoad[()
	{
		PlayAmbient(23);
		if(saved_playklaxxon = 1)
		{
			GetPlayer().PlaySound(70, 16, 0, 128);	
		}
		if(saved_playcar = 1)
		{
			GetPlayer().PlaySound(126, 16, 1, 20);	
		}
		if(saved_levelloaded = 0)
		{
			saved_levelloaded = 1;
			
			SetMessage(96,75,35);
			SetMessage2(537,75,50);
			SetMessage3(509,75,65);
			
			mate = GetEntity("sgt");
			mate.GiveInstructions();		
		}
		if(saved_listening_forshot = 1)
		{
			if(saved_player_hasshot = 0)
			{
				ListenForPlayerShot(true);	
			}
		}	
	}]

	ActorKilled[(who)
	{
		player = GetPlayer();
		group1a = GetEntity("group1a");
		group1b = GetEntity("group1b");
		group1c = GetEntity("group1c");
		group2a = GetEntity("group2a");
		group2b = GetEntity("group2b");
		group2c = GetEntity("group2c");

		if(who = "group1a")
		{
			if((player.GetWalkingState() =0) or (player.GetWalkingState() =1) or (player.GetWalkingState() =4))
			{
				if( not group1b.IsDead() ){ GetEntity("group1b").HeavyPatrol();	}
				if( not group1c.IsDead() ){ GetEntity("group1c").HeavyPatrol(); }
			}
		}

		if(who = "group1b")
		{
			if((player.GetWalkingState() =0) or (player.GetWalkingState() =1) or (player.GetWalkingState() =4))
			{
				if( not group1a.IsDead() ){ GetEntity("group1a").HeavyPatrol();	}
				if( not group1c.IsDead() ){ GetEntity("group1c").HeavyPatrol(); }
			}
		}

		if(who = "group1c")
		{
			if((player.GetWalkingState() =0) or (player.GetWalkingState() =1) or (player.GetWalkingState() =4))
			{
				if( not group1a.IsDead() ){ GetEntity("group1a").HeavyPatrol();	}
				if( not group1b.IsDead() ){ GetEntity("group1b").HeavyPatrol(); }
			}
		}
		if(who = "group2a")
		{
			if((player.GetWalkingState() =0) or (player.GetWalkingState() =1) or (player.GetWalkingState() =4))
			{
				if( not group2b.IsDead() ){ GetEntity("group2b").HeavyPatrol();	}
				if( not group2c.IsDead() ){ GetEntity("group2c").HeavyPatrol(); }
			}
		}

		if(who = "group2b")
		{
			if((player.GetWalkingState() =0) or (player.GetWalkingState() =1) or (player.GetWalkingState() =4))
			{
				if( not group2a.IsDead() ){ GetEntity("group2a").HeavyPatrol();	}
				if( not group2c.IsDead() ){ GetEntity("group2c").HeavyPatrol(); }
			}
		}

		if(who = "group2c")
		{
			if((player.GetWalkingState() =0) or (player.GetWalkingState() =1) or (player.GetWalkingState() =4))
			{
				if( not group2a.IsDead() ){ GetEntity("group2a").HeavyPatrol();	}
				if( not group2b.IsDead() ){ GetEntity("group2b").HeavyPatrol(); }
			}
		}
	}]

	EnterZone[(zone)
	{
		if(zone = "bombzone")
		{
			if (saved_bombzone = 0)
			{
				GetEntity("sgt").PlantBomb();
				saved_bombzone = saved_bombzone+1;
			}
		}
		if(zone = "transposite")
		{
			GetEntity("sgt").GoTrain();
		}
		if(zone = "shotzone")
		{
			Log("better not get trigger happy dick.  :)");
			ListenForPlayerShot(true);
			saved_listening_forshot = 1;
		}
		if(zone = "alert1_block")
		{
			saved_alert1_stop = 1;
		}
		if(zone = "alert2_block")
		{
			saved_alert2_stop = 1;
		}
		if(zone = "alert34_block")
		{
			saved_alert34_stop = 1;
		}
		if(zone = "alert56_block")
		{
			saved_alert56_stop = 1;
		}
		if(zone = "fleepath_2_enable")
		{
			if(saved_fleepath_2_enable = 1)
			{
				saved_fleepath_2_enable = saved_fleepath_2_enable +1;
				Log("It worked");
				GetEntity("sgt").Fleepath2();
				AdvanceObjectives(0);
			}
		}
		if(zone = "fleepath_3_enable")
		{
			if(saved_fleepath_3_enable = 1)
			{
				saved_fleepath_3_enable = saved_fleepath_3_enable +1;
				Log("It worked");
				GetEntity("sgt").Fleepath3();
				AdvanceObjectives(0);
			}
		}
		if(zone = "fleepath_4_enable")
		{
			if(saved_fleepath_4_enable = 1)
			{
				saved_fleepath_4_enable = saved_fleepath_4_enable +1;
				Log("It worked");
				GetEntity("sgt").Fleepath4();
				AdvanceObjectives(1);
			}
		}
		if(zone = "fleepath_5_enable")
		{
			if(saved_fleepath_5_enable = 1)
			{
				saved_fleepath_5_enable = saved_fleepath_5_enable +1;
				GetEntity("sgt").Fleepath5();
				AdvanceObjectives(1);
			}
		}
		if(zone = "fleepath_6_enable")
		{
			if(saved_fleepath_6_enable = 1)
			{
				saved_fleepath_6_enable = saved_fleepath_6_enable +1;
				GetEntity("sgt").Fleepath6();
				AdvanceObjectives(1);
			}
		}
		if(zone = "incarprompt")
		{
			if(saved_incarenable = 0)
			{
				return;
			}
			if(saved_incarenable = 1)
			{
				GetEntity("sgt").InCarPrompt();
				saved_incarenable = 0;
			}
		}
		if(zone = "waypoint")
		{
			Log("--> zone = Waypoint entered");
			if(saved_waypoint_active = 1)
			{
				Log("Waypoint Active, advancing objective, deactivating waypoint.");
				saved_waypoint_active = 0;
				AdvanceObjectives(1);
			}
			if(saved_waypoint_active = 0)
			{
				return;
			}
		}
	}]

	AdvanceObjectives[ (hideLast)
	{
		Log ("--> AdvanceObjectives() ");
		if( saved_CurObjective < saved_NumObjectives )
		{

			NextObj = (saved_CurObjective+1);
			Log ("	 CurrentObjective: " # saved_CurObjective);
			Log ("	 NextObjective: " # NextObj);
			DropObj = (saved_CurObjective-2);

			ObjectiveComplete( saved_CurObjective );

			if( NextObj < saved_NumObjectives )
			{
				if( hideLast = 1 )
				{
					SetObjectiveActive( saved_CurObjective, false );
				}

				SetObjectiveActive( NextObj, true );

				if( Level.saved_CurObjective > 1 )
				{
					Level.SetObjectiveActive( NextObj, true );
					if( hideLast = 0 )
					{
						Level.SetObjectiveActive( DropObj, false );
					}
				}
			}
			saved_CurObjective = NextObj;
		}
	}]

	OnPlayerShot[ ()
	{
		Log("Oh you gonna get it now sucka!  POW!");
		
		saved_player_hasshot = 1;
		
		GetEntity("group1a").PlayerFucked();
		GetEntity("group1b").PlayerFucked();
		GetEntity("group1c").PlayerFucked();
		GetEntity("group2a").PlayerFucked();
		GetEntity("group2b").PlayerFucked();
		GetEntity("group2c").PlayerFucked();

		if(saved_alert1_stop = 0)
		{
			GetEntity("alert1").SetPosition(11184, 13440, 0);
			GetEntity("alert1").TurnToLocation(10192, 14704);
			GetEntity("alert1").HeavyPatrol_2();
		}
		if(saved_alert2_stop = 0)
		{
			GetEntity("alert2").SetPosition(10208, 10992, 0);
			GetEntity("alert2").TurnToLocation(9200, 12976);
			GetEntity("alert2").HeavyPatrol_2();
		}
		if(saved_alert34_stop = 0)
		{
			GetEntity("alert3").SetPosition(8928, 11136, 0);
			GetEntity("alert3").TurnToLocation(8880, 11856);
			GetEntity("alert3").HeavyPatrol_2();
			GetEntity("alert4").SetPosition(6816, 9856, 0);
			GetEntity("alert4").TurnToLocation(9744, 11456);
			GetEntity("alert4").HeavyPatrol_2();
		}
		if(saved_alert56_stop = 0)
		{
			GetEntity("alert5").SetPosition(12512, 9664, 0);
			GetEntity("alert5").TurnToLocation(10208, 9296);
			GetEntity("alert5").HeavyPatrol_2();
			GetEntity("alert6").SetPosition(11456, 10512, 0);
			GetEntity("alert6").TurnToLocation(10208, 9296);
			GetEntity("alert6").HeavyPatrol_2();
		}
	}]
}