private void PlayerSearching()
        {
            if (LastKnownBlip.Exists() && LPlayer.LocalPlayer.Ped.Position.DistanceTo(LastKnownBlip.Position) < 50f)
            {
                //LastKnownBlip.Display = BlipDisplay.Hidden;
                LastKnownBlip.Delete();
            }
            //Has the player spotted the suspect (in front is set to false meaning position can be anywhere)
            if (LPlayer.LocalPlayer.Ped.HasSpottedPed(suspect, false))
            {
                pursuit = Functions.CreatePursuit();
                suspect.AttachBlip().Color = BlipColor.Red;
                Functions.AddTextToTextwall("Control I've located the suspect, in pursuit.", "Officer " + LPlayer.LocalPlayer.Username);
                Functions.AddPedToPursuit(pursuit, suspect);
                Functions.SetPursuitCalledIn(pursuit, true);

                Functions.SetPursuitCopsCanJoin(pursuit, true);
                Functions.SetPursuitIsActiveForPlayer(pursuit, true);
                State = EPedState.None;
            }

            if (LPlayer.LocalPlayer.Ped.Position.DistanceTo(getawayCar.Position) > 600f)
            {
                Functions.AddTextToTextwall("Control, suspect was never found, resuming patrol.", "Officer " + LPlayer.LocalPlayer.Username);
                Functions.AddTextToTextwall("Affirmative, we'll send details to ANPR database.", "CONTROL");
                End();
            }
        }
 public override void End()
 {
     base.End();
     if (pursuit != null)
     {
         Functions.ForceEndPursuit(pursuit);
     }
     if (copCar != null && copCar.Exists())
     {
         copCar.Delete();
     }
     if (getawayCar != null && getawayCar.Exists())
     {
         getawayCar.NoLongerNeeded();
     }
     if (blip != null && blip.Exists())
     {
         blip.Delete();
     }
     if (LastKnownBlip != null && LastKnownBlip.Exists())
     {
         LastKnownBlip.Delete();
     }
 }