Beispiel #1
0
        public override void OnArrivalAtScene()
        {
            base.OnArrivalAtScene();

            Suspect mySuspect = (Suspect)GetPed("Suspect1");

            if (mySuspect != null && mySuspect.Exists())
            {
                pursuit = Functions.CreatePursuit();
                Functions.AddPedToPursuit(pursuit, mySuspect);
            }
        }
Beispiel #2
0
        private void DisplayCodeFourMessage()
        {
            if (CalloutRunning)
            {
                msg = "";
                if (Suspect.Exists())
                {
                    if (Functions.IsPedArrested(Suspect))
                    {
                        msg = "The suspect is ~g~under arrest~s~. ";
                    }
                    else if (Suspect.IsDead)
                    {
                        msg = "The suspect is ~o~dead~s~. ";
                    }
                }
                if (Victim.Exists())
                {
                    if (Victim.IsAlive)
                    {
                        msg += "The victim ~g~survived. ~s~";
                    }
                    else
                    {
                        msg += "The victim ~r~was killed. ~s~";
                    }
                }
                msg += "We are ~g~CODE 4~s~.";
                GameFiber.Sleep(4000);
                Game.DisplayNotification("3dtextures", "mpgroundlogo_cops", "Person with a knife", "Dispatch to ~b~" + AssortedCalloutsHandler.DivisionUnitBeat, msg);



                Functions.PlayScannerAudio("ATTENTION_THIS_IS_DISPATCH_HIGH WE_ARE_CODE FOUR NO_FURTHER_UNITS_REQUIRED");
                CalloutFinished = true;
                End();
            }
        }
Beispiel #3
0
        public override bool OnBeforeCalloutDisplayed()
        {
            //Create our ped in the world
            Suspect myPed = new Suspect("Suspect1", "a_m_y_mexthug_01", SpawnPoint.Around(10), 0);

            //Create the vehicle for our ped
            Vehicle myVehicle = new Vehicle("DUKES2", SpawnPoint);

            //Now we have spawned them, check they actually exist and if not return false (preventing the callout from being accepted and aborting it)
            if (!myPed.Exists())
            {
                return(false);
            }
            if (!myVehicle.Exists())
            {
                return(false);
            }

            //Add the Ped to the callout's list of Peds
            Peds.Add(myPed);

            //If we made it this far both exist so let's warp the ped into the driver seat
            myPed.WarpIntoVehicle(myVehicle, -1);

            // Show the user where the pursuit is about to happen and block very close peds.
            this.ShowCalloutAreaBlipBeforeAccepting(SpawnPoint, 15f);
            this.AddMinimumDistanceCheck(5f, myPed.Position);

            // Set up our callout message and location
            this.CalloutMessage  = "Example Callout Message";
            this.CalloutPosition = SpawnPoint;

            //Play the police scanner audio for this callout (available as of the 0.2a API)
            Functions.PlayScannerAudioUsingPosition("CITIZENS_REPORT CRIME_RESIST_ARREST IN_OR_ON_POSITION", SpawnPoint);

            return(base.OnBeforeCalloutDisplayed());
        }
Beispiel #4
0
        private void CalloutHandler()
        {
            CalloutRunning = true;
            GameFiber.StartNew(delegate
            {
                try
                {
                    Pursuit = Functions.CreatePursuit();

                    NativeFunction.CallByName <uint>("SET_DRIVER_ABILITY", Suspect, 1.0f);
                    NativeFunction.CallByName <uint>("SET_DRIVER_AGGRESSIVENESS", Suspect, 1.0f);

                    Functions.AddPedToPursuit(Pursuit, Suspect);

                    if (AssortedCalloutsHandler.rnd.Next(3) == 0)
                    {
                        Passenger = new Ped(Vector3.Zero);
                        Passenger.MakeMissionPed();

                        Passenger.WarpIntoVehicle(SuspectCar, 0);
                        Functions.AddPedToPursuit(Pursuit, Passenger);
                    }
                    Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
                    GameFiber.Wait(3000);
                    Vehicle Backupveh  = Functions.RequestBackup(Suspect.Position, LSPD_First_Response.EBackupResponseType.Pursuit, LSPD_First_Response.EBackupUnitType.LocalUnit);
                    Backupveh.Position = SpawnPoint;
                    Backupveh.Heading  = SpawnHeading;
                    NativeFunction.Natives.SET_VEHICLE_FORWARD_SPEED(Backupveh, 10f);
                    Game.DisplayNotification("~b~Pursuing Officer: ~s~Suspect is on ~b~" + World.GetStreetName(Suspect.Position) + ". ~s~Speed is ~r~" + Math.Round(MathHelper.ConvertMetersPerSecondToMilesPerHour(Suspect.Speed)).ToString() + " MPH.");
                    SuspectBlip                = Suspect.AttachBlip();
                    SuspectBlip.Scale          = 0.1f;
                    SuspectBlip.IsRouteEnabled = true;
                    SuspectBlip.RouteColor     = Color.Red;
                    if (SuspectCar.HasSiren)
                    {
                        SuspectCar.IsSirenOn = true;
                    }
                    if (!Passenger.Exists())
                    {
                        while (CalloutRunning)
                        {
                            GameFiber.Yield();


                            if (!Suspect.Exists())
                            {
                                msg = "Control, the ~r~suspect~s~ has ~r~escaped.~s~ Hot pursuit is code 4, over.";
                                break;
                            }
                            else if (Functions.IsPedArrested(Suspect))
                            {
                                msg = "Control, the ~r~suspect~s~ is ~g~under arrest.~s~ Hot pursuit is code 4, over.";
                                break;
                            }
                            else if (Suspect.IsDead)
                            {
                                msg = "Control, the ~r~suspect~s~ is ~o~dead.~s~ Hot pursuit is code 4, over.";
                                break;
                            }

                            if (Vector3.Distance(Suspect.Position, Game.LocalPlayer.Character.Position) < 60f)
                            {
                                if (SuspectBlip.Exists())
                                {
                                    SuspectBlip.Delete();
                                }
                            }
                        }
                    }
                    else if (CalloutRunning)
                    {
                        Functions.AddPedToPursuit(Pursuit, Passenger);
                        PassengerState = SuspectStates.InPursuit;
                        SuspectState   = SuspectStates.InPursuit;

                        while (CalloutRunning)
                        {
                            GameFiber.Yield();

                            if (SuspectState == SuspectStates.InPursuit)
                            {
                                if (!Suspect.Exists())
                                {
                                    SuspectState = SuspectStates.Escaped;
                                }
                                else if (Suspect.IsDead)
                                {
                                    SuspectState = SuspectStates.Dead;
                                }
                                else if (Functions.IsPedArrested(Suspect))
                                {
                                    SuspectState = SuspectStates.Arrested;
                                }
                            }
                            if (PassengerState == SuspectStates.InPursuit)
                            {
                                if (!Passenger.Exists())
                                {
                                    PassengerState = SuspectStates.Escaped;
                                }
                                else if (Passenger.IsDead)
                                {
                                    PassengerState = SuspectStates.Dead;
                                }
                                else if (Functions.IsPedArrested(Passenger))
                                {
                                    PassengerState = SuspectStates.Arrested;
                                }
                            }
                            if ((SuspectState != SuspectStates.InPursuit) && (PassengerState != SuspectStates.InPursuit))
                            {
                                break;
                            }

                            if (Vector3.Distance(Suspect.Position, Game.LocalPlayer.Character.Position) < 60f)
                            {
                                if (SuspectBlip.Exists())
                                {
                                    SuspectBlip.Delete();
                                }
                            }
                        }
                        msg = "Control, the driver's ";
                        if (SuspectState == SuspectStates.Arrested)
                        {
                            msg += "~g~under arrest.";
                        }
                        else if (SuspectState == SuspectStates.Dead)
                        {
                            msg += "~o~dead.";
                        }
                        else if (SuspectState == SuspectStates.Escaped)
                        {
                            msg += "~r~escaped.";
                        }

                        msg += "~s~ The passenger's ";
                        if (PassengerState == SuspectStates.Arrested)
                        {
                            msg += "~g~under arrest.";
                        }
                        else if (PassengerState == SuspectStates.Dead)
                        {
                            msg += "~o~dead.";
                        }
                        else if (PassengerState == SuspectStates.Escaped)
                        {
                            msg += "~r~escaped.";
                        }
                        msg += "~s~ Hot pursuit is code 4, over.";
                    }
                    DisplayCodeFourMessage();
                }
                catch (System.Threading.ThreadAbortException e)
                {
                    End();
                }
                catch (Exception e)
                {
                    if (CalloutRunning)
                    {
                        Game.LogTrivial(e.ToString());
                        Game.LogTrivial("British Policing Script handled the exception successfully.");
                        Game.DisplayNotification("~O~Failtostop~s~ callout crashed, sorry. Please send me your log file.");
                        Game.DisplayNotification("Full LSPDFR crash prevented ~g~successfully.");
                        End();
                    }
                }
            });
        }
        private void CalloutHandler()
        {
            CalloutRunning = true;
            GameFiber.StartNew(delegate
            {
                try
                {
                    GameFiber.Yield();
                    Suspect.Model.LoadAndWait();
                    if (AssortedCalloutsHandler.rnd.Next(2) == 0)
                    {
                        Passenger = new Ped(Vector3.Zero);
                        Passenger.MakeMissionPed();

                        Passenger.WarpIntoVehicle(SuspectCar, 0);
                        if (AssortedCalloutsHandler.rnd.Next(2) == 0)
                        {
                            Passenger.Inventory.GiveNewWeapon(new WeaponAsset("WEAPON_MICROSMG"), -1, true);
                            Game.DisplayNotification("~b~Control: ~s~There's intel linking this theft to ~r~dangerous, organised criminals.");
                            if (ComputerPlusRunning)
                            {
                                API.ComputerPlusFuncs.AddUpdateToCallout(CalloutID, "There's intel linking this theft to ~r~dangerous, organised criminals.");
                            }
                        }
                    }
                    Suspect.Tasks.CruiseWithVehicle(SuspectCar, 18f, (VehicleDrivingFlags.FollowTraffic | VehicleDrivingFlags.YieldToCrossingPedestrians));
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (Vector3.Distance(Suspect.Position, Game.LocalPlayer.Character.Position) < 14f)
                        {
                            if (Math.Abs(Suspect.Position.Z - Game.LocalPlayer.Character.Position.Z) < 1.2f)
                            {
                                GameFiber.Wait(1200);
                                break;
                            }
                        }
                    }
                    if (CalloutRunning)
                    {
                        if (ComputerPlusRunning)
                        {
                            API.ComputerPlusFuncs.AddUpdateToCallout(CalloutID, "Vehicle is fleeing. In pursuit");
                            API.ComputerPlusFuncs.AddVehicleToCallout(CalloutID, SuspectCar);
                        }
                        if (SuspectBlip.Exists())
                        {
                            SuspectBlip.Delete();
                        }
                        SuspectCar.IsSirenOn     = true;
                        SuspectCar.IsSirenSilent = false;
                        Pursuit = Functions.CreatePursuit();
                        Functions.AddPedToPursuit(Pursuit, Suspect);
                        Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
                        //Functions.SetPursuitDisableAI(Pursuit, true);
                        //Suspect.Tasks.CruiseWithVehicle(SuspectCar, 50f, VehicleDrivingFlags.Emergency);
                        GameFiber.Wait(3000);
                        //Functions.SetPursuitDisableAI(Pursuit, false);

                        //Functions.SetPursuitDisableAI(Pursuit, false);
                        Functions.PlayScannerAudioUsingPosition("WE_HAVE CRIME_RESIST_ARREST IN_OR_ON_POSITION", Game.LocalPlayer.Character.Position);
                    }
                    if (!Passenger.Exists())
                    {
                        while (CalloutRunning)
                        {
                            GameFiber.Yield();
                            Rage.Native.NativeFunction.Natives.SET_AI_MELEE_WEAPON_DAMAGE_MODIFIER(5.5f);
                            if (!Suspect.Exists())
                            {
                                msg = "Control, the ~r~suspect~s~ has ~r~escaped.~s~ We are ~r~CODE 4~s~, over.";
                                break;
                            }
                            else if (Functions.IsPedArrested(Suspect))
                            {
                                msg = "Control, the ~r~suspect~s~ is ~g~under arrest. ~s~We are ~g~CODE 4~s~, over.";
                                break;
                            }
                            else if (Suspect.IsDead)
                            {
                                msg = "Control, the ~r~suspect~s~ is ~o~dead. ~s~We are ~o~CODE 4~s~, over.";
                                break;
                            }
                        }
                    }
                    else if (CalloutRunning)
                    {
                        Functions.AddPedToPursuit(Pursuit, Passenger);
                        PassengerState         = SuspectStates.InPursuit;
                        SuspectState           = SuspectStates.InPursuit;
                        bool passengershooting = false;
                        while (CalloutRunning)
                        {
                            GameFiber.Yield();
                            Rage.Native.NativeFunction.Natives.SET_AI_MELEE_WEAPON_DAMAGE_MODIFIER(5.5f);
                            if (SuspectState == SuspectStates.InPursuit)
                            {
                                if (!Suspect.Exists())
                                {
                                    SuspectState = SuspectStates.Escaped;
                                }
                                else if (Suspect.IsDead)
                                {
                                    SuspectState = SuspectStates.Dead;
                                }
                                else if (Functions.IsPedArrested(Suspect))
                                {
                                    SuspectState = SuspectStates.Arrested;
                                }
                            }



                            if (PassengerState == SuspectStates.InPursuit)
                            {
                                if (!Passenger.Exists())
                                {
                                    PassengerState = SuspectStates.Escaped;
                                }
                                else if (Passenger.IsDead)
                                {
                                    PassengerState = SuspectStates.Dead;
                                }
                                else if (Functions.IsPedArrested(Passenger))
                                {
                                    PassengerState = SuspectStates.Arrested;
                                }
                            }

                            if (Game.LocalPlayer.Character.IsDead)
                            {
                                Functions.PlayScannerAudio("OFFICER HAS_BEEN_FATALLY_SHOT NOISE_SHORT OFFICER_NEEDS_IMMEDIATE_ASSISTANCE");
                                break;
                            }
                            if ((SuspectState != SuspectStates.InPursuit) && (PassengerState != SuspectStates.InPursuit))
                            {
                                break;
                            }
                            if (PassengerState == SuspectStates.InPursuit)
                            {
                                if (Passenger.IsInVehicle(SuspectCar, false))
                                {
                                    if (!passengershooting)
                                    {
                                        if (Vector3.Distance(Passenger.Position, Game.LocalPlayer.Character.Position) < 15f)
                                        {
                                            passengershooting = true;
                                            NativeFunction.Natives.TASK_DRIVE_BY(Passenger, Game.LocalPlayer.Character, 0, 0, 0, 0, 50.0f, 100, 1, Game.GetHashKey("firing_pattern_burst_fire_driveby"));
                                        }
                                    }
                                    else
                                    {
                                        if (Vector3.Distance(Passenger.Position, Game.LocalPlayer.Character.Position) > 25f)
                                        {
                                            Passenger.Tasks.ClearSecondary();

                                            passengershooting = false;
                                        }
                                    }
                                }
                            }
                        }
                        msg = "Control, the driver ";
                        if (SuspectState == SuspectStates.Arrested)
                        {
                            msg += "is ~g~under arrest.";
                        }
                        else if (SuspectState == SuspectStates.Dead)
                        {
                            msg += "is ~o~dead.";
                        }
                        else if (SuspectState == SuspectStates.Escaped)
                        {
                            msg += "has ~r~escaped.";
                        }

                        msg += "~s~ The passenger ";
                        if (PassengerState == SuspectStates.Arrested)
                        {
                            msg += "is ~g~under arrest.";
                        }
                        else if (PassengerState == SuspectStates.Dead)
                        {
                            msg += "is ~o~dead.";
                        }
                        else if (PassengerState == SuspectStates.Escaped)
                        {
                            msg += "has ~r~escaped.";
                        }
                        msg += "~s~ We are ~g~CODE 4, ~s~over.";
                    }
                    DisplayCodeFourMessage();
                }
                catch (System.Threading.ThreadAbortException e)
                {
                    End();
                }
                catch (Exception e)
                {
                    if (CalloutRunning)
                    {
                        Game.LogTrivial(e.ToString());
                        Game.LogTrivial("Assorted Callouts handled the exception successfully.");
                        Game.DisplayNotification("~O~Stolen Police Vehicle~s~callout crashed, sorry. Please send me your log file.");
                        Game.DisplayNotification("Full LSPDFR crash prevented ~g~successfully.");
                        End();
                    }
                }
            });
        }
        private void CalloutHandler()
        {
            CalloutRunning = true;
            GameFiber.StartNew(delegate
            {
                try {
                    //Responding...

                    Suspect.Tasks.CruiseWithVehicle(SuspectCar, 17f, VehicleDrivingFlags.Normal);
                    Game.DisplayNotification("3dtextures", "mpgroundlogo_cops", "Assorted Callouts", PetrolGas + " Theft", "~b~Control: ~s~We have reports of a ~r~" + PetrolGas.ToLower() + " theft. ~s~Please respond ~b~CODE 2~s~.");
                    Functions.PlayScannerAudio("REPORT_RESPONSE_COPY UNITS_RESPOND_CODE_02_02");

                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        Rage.Native.NativeFunction.Natives.SET_DRIVE_TASK_DRIVING_STYLE(Suspect, 786603);
                        if (Vector3.Distance(Game.LocalPlayer.Character.Position, Shopkeeper.Position) < 15f)
                        {
                            ShopkeeperBlip.IsRouteEnabled        = false;
                            Vector3 directionFromShopkeeperToCar = (Game.LocalPlayer.Character.Position - Shopkeeper.Position);
                            directionFromShopkeeperToCar.Normalize();
                            Shopkeeper.Tasks.AchieveHeading(MathHelper.ConvertDirectionToHeading(directionFromShopkeeperToCar)).WaitForCompletion(1100);
                            Shopkeeper.Tasks.PlayAnimation("friends@frj@ig_1", "wave_a", 1.1f, AnimationFlags.Loop);
                            if (!Game.LocalPlayer.Character.IsInAnyVehicle(false))
                            {
                                if (ComputerPlusRunning)
                                {
                                    API.ComputerPlusFuncs.SetCalloutStatusToAtScene(CalloutID);
                                }
                                break;
                            }
                        }
                    }

                    //On scene

                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (Vector3.Distance(Game.LocalPlayer.Character.Position, Shopkeeper.Position) < 6f)
                        {
                            Game.DisplayHelp("Press ~b~" + AssortedCalloutsHandler.kc.ConvertToString(AssortedCalloutsHandler.TalkKey) + " ~s~to talk.");
                            if (Albo1125.Common.CommonLibrary.ExtensionMethods.IsKeyDownComputerCheck(AssortedCalloutsHandler.TalkKey))
                            {
                                Shopkeeper.Tasks.ClearImmediately();

                                break;
                            }
                        }
                        else
                        {
                            Game.HideHelp();
                        }
                    }
                    ShopkeeperBlip.Delete();
                    //CCTV and Dialogue
                    DetermineShopkeeperLines();
                    SpeechHandler.HandleSpeech("Shopkeeper", ShopkeeperLines, Shopkeeper);
                    if (ShowCCTV)
                    {
                        GameFiber.Sleep(2000);
                        WatchCameraFootage();
                    }
                    ShopkeeperLines.Clear();
                    if (ShopkeeperKnowsVehicleDetails)
                    {
                        ShopkeeperLines.Add("The vehicle was a ~b~" + CarColor + " ~b~" + CarModelName + " ~s~.");
                        ShopkeeperLines.Add("The licence plate was ~b~" + SuspectCar.LicensePlate + ".");
                        ShopkeeperLines.Add("They took off in that direction!");
                        SpeechHandler.HandleSpeech("Shopkeeper", ShopkeeperLines, Shopkeeper);
                    }
                    else
                    {
                        OfficerLines = new List <string>()
                        {
                            "I can make out the vehicle's details from the CCTV footage!", "The vehicle was a ~b~" + CarColor + " ~b~" + CarModelName + ".", "The licence plate was ~b~" + SuspectCar.LicensePlate + ".", "In which direction did they go?"
                        };
                        SpeechHandler.HandleSpeech("You", OfficerLines, Game.LocalPlayer.Character);
                        ShopkeeperLines.Clear();
                        ShopkeeperLines.Add("They made off in that direction, officer!");
                        SpeechHandler.HandleSpeech("Shopkeeper", ShopkeeperLines, Shopkeeper);
                    }


                    GameFiber.Yield();
                    SuspectCar.Position = Game.LocalPlayer.Character.Position.Around(250f).GetClosestMajorVehicleNode();
                    while (Vector3.Distance(SuspectCar.Position, Game.LocalPlayer.Character.Position) < 170f)
                    {
                        GameFiber.Yield();
                        SuspectCar.Position = Game.LocalPlayer.Character.Position.Around(250f).GetClosestMajorVehicleNode();
                    }


                    Vector3 directionFromShopkeeperToCar1 = (SuspectCar.Position - Shopkeeper.Position);
                    directionFromShopkeeperToCar1.Normalize();
                    Shopkeeper.Tasks.AchieveHeading(MathHelper.ConvertDirectionToHeading(directionFromShopkeeperToCar1)).WaitForCompletion(1200);
                    Shopkeeper.Tasks.PlayAnimation("gestures@f@standing@casual", "gesture_point", 0.8f, AnimationFlags.Loop);
                    GameFiber.Sleep(3000);
                    Game.DisplayNotification("Control, ~r~suspect's vehicle~s~ is a ~b~" + CarColor + " ~b~" + CarModelName + ".");
                    GameFiber.Sleep(2000);
                    Game.DisplayNotification("The plate is ~b~" + SuspectCar.LicensePlate + ". ~s~~n~Please pass on the details, I'm ~b~checking the area~s~, over.");
                    if (ComputerPlusRunning)
                    {
                        API.ComputerPlusFuncs.AddUpdateToCallout(CalloutID, "Suspect's vehicle is a " + CarColor + " " + CarModelName + ".");
                        API.ComputerPlusFuncs.AddUpdateToCallout(CalloutID, "The plate is " + SuspectCar.LicensePlate + ". Checking the area.");
                    }
                    //Searching...
                    HandleSearchForVehicleWithANPR();
                    if (ComputerPlusRunning)
                    {
                        API.ComputerPlusFuncs.AddUpdateToCallout(CalloutID, "Vehicle located. Engaging traffic stop.");
                    }
                    //float Radius = 140f;
                    //bool RouteEnabled = false;
                    //SearchArea = new Blip(SuspectCar.Position.Around(35f), Radius);
                    //SearchArea.Color = System.Drawing.Color.Yellow;
                    //SearchArea.Alpha = 0.5f;
                    //Shopkeeper.Tasks.ClearImmediately();


                    //Suspect.Tasks.CruiseWithVehicle(SuspectCar, 18f, VehicleDrivingFlags.Normal);
                    //int WaitCount = 0;
                    //int WaitCountTarget = 3100;
                    //while (CalloutRunning)
                    //{
                    //    GameFiber.Yield();
                    //    WaitCount++;
                    //    Rage.Native.NativeFunction.Natives.SET_DRIVE_TASK_DRIVING_STYLE( Suspect, 786603);

                    //    if (Vector3.Distance(Game.LocalPlayer.Character.GetOffsetPosition(Vector3.RelativeFront * 9f), SuspectCar.Position) < 9f)
                    //    {
                    //        GameFiber.Sleep(2000);
                    //        if (Vector3.Distance(Game.LocalPlayer.Character.GetOffsetPosition(Vector3.RelativeFront * 9f), SuspectCar.Position) < 9f)
                    //        {
                    //            Game.DisplayNotification("Control, I have located the ~b~" + CarModelName + "~s~ from the ~r~" + PetrolGas.ToLower() + " theft.");
                    //            Game.DisplayNotification("I'm preparing to ~b~stop them,~s~ over.");
                    //            SuspectBlip = Suspect.AttachBlip();
                    //            if (SearchArea.Exists()) { SearchArea.Delete(); }
                    //            Functions.PlayScannerAudio("DISPATCH_SUSPECT_LOCATED_ENGAGE REPORT_RESPONSE");

                    //            break;
                    //        }

                    //    }
                    //    else if (((Vector3.Distance(SuspectCar.Position, SearchArea.Position) > Radius + 230f) && (WaitCount > 1000)) || (WaitCount > WaitCountTarget))
                    //    {
                    //        Game.DisplayNotification("~b~Control: ~s~We have an ~o~ANPR Hit ~s~on ~b~" + SuspectCar.LicensePlate + ". ~g~Search area updated, ~s~over.");
                    //        Functions.PlayScannerAudioUsingPosition("WE_HAVE_01 CRIME_TRAFFIC_ALERT IN_OR_ON_POSITION", SuspectCar.Position);
                    //        SearchArea.Delete();
                    //        Radius = 50f;
                    //        SearchArea = new Blip(SuspectCar.Position.Around(8f), Radius);
                    //        SearchArea.Color = System.Drawing.Color.Yellow;
                    //        SearchArea.Alpha = 0.5f;

                    //        RouteEnabled = false;
                    //        if (WaitCount > WaitCountTarget) { Game.LogTrivial("Updated for waitcount"); }
                    //        WaitCount = 0;
                    //        Suspect.Tasks.PerformDrivingManeuver(VehicleManeuver.Wait).WaitForCompletion(1000);
                    //        Suspect.Tasks.CruiseWithVehicle(SuspectCar, 17f, VehicleDrivingFlags.DriveAroundVehicles | VehicleDrivingFlags.DriveAroundObjects | VehicleDrivingFlags.DriveAroundPeds);
                    //        WaitCountTarget -= EntryPoint.rnd.Next(200,500);
                    //        if (WaitCountTarget < 1900) { WaitCountTarget = 1900; }

                    //    }
                    //    if (Vector3.Distance(Game.LocalPlayer.Character.Position, SearchArea.Position) > Radius + 90f)
                    //    {
                    //        if (!RouteEnabled)
                    //        {
                    //            SearchArea.IsRouteEnabled = true;
                    //            RouteEnabled = true;
                    //        }
                    //    }
                    //    else
                    //    {
                    //        if (RouteEnabled)
                    //        {
                    //            SearchArea.IsRouteEnabled = false;
                    //            RouteEnabled = false;
                    //        }
                    //    }
                    //}

                    //Found
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (!CalloutRunning)
                        {
                            break;
                        }
                        if (!Game.LocalPlayer.Character.IsInAnyVehicle(false))
                        {
                            break;
                        }
                        if (Functions.IsPlayerPerformingPullover())
                        {
                            if (Functions.GetPulloverSuspect(Functions.GetCurrentPullover()) == Suspect)

                            {
                                break;
                            }
                        }
                    }
                    if (Functions.IsPlayerPerformingPullover())
                    {
                        GameFiber.Wait(3000);
                    }
                    //How they react:

                    if (SuspectBlip.Exists())
                    {
                        SuspectBlip.Delete();
                    }
                    if ((AssortedCalloutsHandler.rnd.Next(11) <= 5) || (!Game.LocalPlayer.Character.IsInAnyVehicle(false)) || Functions.GetActivePursuit() != null)
                    {
                        if (CalloutRunning)
                        {
                            if (Functions.GetActivePursuit() != null)
                            {
                                Functions.ForceEndPursuit(Functions.GetActivePursuit());
                            }
                            Pursuit = Functions.CreatePursuit();
                            Functions.AddPedToPursuit(Pursuit, Suspect);
                            Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
                            if (Functions.IsPlayerPerformingPullover())
                            {
                                Functions.ForceEndCurrentPullover();
                            }
                            Functions.PlayScannerAudioUsingPosition("WE_HAVE CRIME_RESIST_ARREST IN_OR_ON_POSITION", Game.LocalPlayer.Character.Position);
                            if (AssortedCalloutsHandler.English == AssortedCalloutsHandler.EnglishTypes.BritishEnglish)
                            {
                                Game.DisplayNotification("Control, the vehicle is ~r~making off.~b~ Giving chase.");
                            }
                            else
                            {
                                Game.DisplayNotification("Control, the vehicle is ~r~fleeing,~b~ In pursuit.");
                            }
                            if (ComputerPlusRunning)
                            {
                                API.ComputerPlusFuncs.AddUpdateToCallout(CalloutID, "Vehicle is fleeing. Engaging pursuit.");
                            }

                            while (Functions.IsPursuitStillRunning(Pursuit))
                            {
                                GameFiber.Yield();
                                if (!CalloutRunning)
                                {
                                    break;
                                }
                            }
                        }
                    }


                    else
                    {
                        while (CalloutRunning)
                        {
                            GameFiber.Yield();
                            if (!Game.LocalPlayer.Character.IsInAnyVehicle(false))
                            {
                                GameFiber.Wait(1000);
                                if (AssortedCalloutsHandler.rnd.Next(5) == 0)
                                {
                                    Pursuit = Functions.CreatePursuit();
                                    Functions.AddPedToPursuit(Pursuit, Suspect);
                                    Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
                                    if (Functions.IsPlayerPerformingPullover())
                                    {
                                        Functions.ForceEndCurrentPullover();
                                    }

                                    Functions.PlayScannerAudioUsingPosition("WE_HAVE CRIME_RESIST_ARREST IN_OR_ON_POSITION", Game.LocalPlayer.Character.Position);
                                    if (AssortedCalloutsHandler.English == AssortedCalloutsHandler.EnglishTypes.BritishEnglish)
                                    {
                                        Game.DisplayNotification("Control, the vehicle is ~r~making off.~b~ Giving chase.");
                                    }
                                    else
                                    {
                                        Game.DisplayNotification("Control, the vehicle is ~r~fleeing,~b~ In pursuit.");
                                    }
                                    if (ComputerPlusRunning)
                                    {
                                        API.ComputerPlusFuncs.AddUpdateToCallout(CalloutID, "Vehicle is fleeing. Engaging pursuit.");
                                    }
                                }
                                break;
                            }
                        }
                        while (CalloutRunning)
                        {
                            GameFiber.Yield();
                            if (Suspect.Exists())
                            {
                                if (Functions.IsPedArrested(Suspect))
                                {
                                    break;
                                }
                                if (Suspect.IsDead)
                                {
                                    break;
                                }
                            }
                            else
                            {
                                break;
                            }
                        }
                    }
                    //Done
                    if (Suspect.Exists())
                    {
                        if (Functions.IsPedArrested(Suspect))
                        {
                            msg = "Control, suspect is ~g~under arrest. ~s~The ~r~" + PetrolGas.ToLower() + " theft~s~ call is ~g~CODE 4~s~, over.";
                        }
                        else if (Suspect.IsDead)
                        {
                            msg = "Control, suspect is ~r~dead. ~s~The ~r~" + PetrolGas.ToLower() + " theft~s~ call is ~g~CODE 4~s~, over.";
                        }
                    }
                    else
                    {
                        msg = "Control, the suspects ~r~have escaped. ~s~The ~r~" + PetrolGas.ToLower() + " theft~s~ call is ~g~CODE 4~s~, over.";
                    }
                    if (CalloutRunning)
                    {
                        GameFiber.Sleep(4000);
                        Game.DisplayNotification("3dtextures", "mpgroundlogo_cops", "Assorted Callouts", PetrolGas + " Theft", msg);

                        Functions.PlayScannerAudio("ATTENTION_THIS_IS_DISPATCH_HIGH WE_ARE_CODE FOUR NO_FURTHER_UNITS_REQUIRED");
                        CalloutFinished = true;
                        End();
                    }
                }
                catch (Exception e)
                {
                    Game.LogTrivial(e.ToString());
                    End();
                }
            });
        }
        private void CalloutHandler()
        {
            CalloutRunning = true;
            GameFiber.StartNew(delegate
            {
                try
                {
                    GameFiber.Wait(1000);
                    Pursuit = Functions.CreatePursuit();
                    SuspectBritishPersona = BritishPersona.GetBritishPersona(Suspect);


                    Functions.AddPedToPursuit(Pursuit, Suspect);

                    if (EntryPoint.rnd.Next(3) == 0)
                    {
                        Passenger = new Ped(Vector3.Zero);
                        Passenger.MakeMissionPed();

                        Passenger.WarpIntoVehicle(SuspectCar, 0);
                        Functions.AddPedToPursuit(Pursuit, Passenger);
                    }

                    Functions.SetPursuitIsActiveForPlayer(Pursuit, true);

                    GameFiber.Wait(3000);
                    Vehicle Backupveh  = Functions.RequestBackup(Suspect.Position, LSPD_First_Response.EBackupResponseType.Pursuit, LSPD_First_Response.EBackupUnitType.LocalUnit);
                    Backupveh.Position = sp;
                    Backupveh.Heading  = sp;
                    Game.DisplayNotification("~b~Pursuing Officer: ~s~Suspect is on ~b~" + World.GetStreetName(Suspect.Position) + ". ~s~Speed is ~r~" + Math.Round(MathHelper.ConvertMetersPerSecondToMilesPerHour(Suspect.Speed)).ToString() + " MPH.");
                    SuspectBlip                = Suspect.AttachBlip();
                    SuspectBlip.Scale          = 0.1f;
                    SuspectBlip.IsRouteEnabled = true;
                    SuspectBlip.RouteColor     = Color.Red;



                    if (!Passenger.Exists())
                    {
                        while (CalloutRunning)
                        {
                            GameFiber.Yield();

                            Rage.Native.NativeFunction.Natives.SET_AI_MELEE_WEAPON_DAMAGE_MODIFIER(5.5f);
                            if (!Suspect.Exists())
                            {
                                msg = "Control, the ~r~suspect~s~ has ~r~escaped.~s~ I'm state 2, over.";
                                break;
                            }
                            else if (Functions.IsPedArrested(Suspect))
                            {
                                msg = "Control, the ~r~suspect~s~ is ~g~under arrest.~s~ I'm state 2, over.";
                                string sentence;
                                if (EntryPoint.rnd.Next(6) < 3)
                                {
                                    int HoursUnpaidWork = (int)Math.Round(((float)EntryPoint.rnd.Next(150, 300)) / 5.0f) * 5;

                                    int Costs = (int)Math.Round(((float)EntryPoint.rnd.Next(165)) / 5.0f) * 5;
                                    sentence  = "Community order made with " + HoursUnpaidWork.ToString() + " hours unpaid work. Disqualified from driving for " + EntryPoint.rnd.Next(12, 24).ToString() + " months. " + Costs.ToString() + " pounds in costs.";
                                }
                                else
                                {
                                    int JailMonths = (int)Math.Round(((float)EntryPoint.rnd.Next(4, 19)) / 5.0f) * 5;
                                    int Costs      = (int)Math.Round(((float)EntryPoint.rnd.Next(165)) / 5.0f) * 5;
                                    sentence       = "Sentenced to  " + JailMonths.ToString() + " months in prison. Disqualified from driving for " + EntryPoint.rnd.Next(12, 24).ToString() + " months. " + Costs.ToString() + " pounds in costs.";
                                }



                                CourtSystem.CreateNewCourtCase(SuspectBritishPersona, "failing to stop for police and dangerous driving", 100, sentence);
                                break;
                            }
                            else if (Suspect.IsDead)
                            {
                                msg = "Control, the ~r~suspect~s~ is ~o~dead.~s~ I'm state 2, over.";
                                break;
                            }

                            if (Vector3.Distance(Suspect.Position, Game.LocalPlayer.Character.Position) < 60f)
                            {
                                if (SuspectBlip.Exists())
                                {
                                    SuspectBlip.Delete();
                                }
                            }
                        }
                    }
                    else if (CalloutRunning)
                    {
                        Functions.AddPedToPursuit(Pursuit, Passenger);
                        PassengerState = SuspectStates.InPursuit;
                        SuspectState   = SuspectStates.InPursuit;

                        while (CalloutRunning)
                        {
                            GameFiber.Yield();

                            if (SuspectState == SuspectStates.InPursuit)
                            {
                                if (!Suspect.Exists())
                                {
                                    SuspectState = SuspectStates.Escaped;
                                }
                                else if (Suspect.IsDead)
                                {
                                    SuspectState = SuspectStates.Dead;
                                }
                                else if (Functions.IsPedArrested(Suspect))
                                {
                                    SuspectState = SuspectStates.Arrested;
                                }
                            }



                            if (PassengerState == SuspectStates.InPursuit)
                            {
                                if (!Passenger.Exists())
                                {
                                    PassengerState = SuspectStates.Escaped;
                                }
                                else if (Passenger.IsDead)
                                {
                                    PassengerState = SuspectStates.Dead;
                                }
                                else if (Functions.IsPedArrested(Passenger))
                                {
                                    PassengerState = SuspectStates.Arrested;
                                }
                            }
                            if ((SuspectState != SuspectStates.InPursuit) && (PassengerState != SuspectStates.InPursuit))
                            {
                                break;
                            }

                            if (Vector3.Distance(Suspect.Position, Game.LocalPlayer.Character.Position) < 60f)
                            {
                                if (SuspectBlip.Exists())
                                {
                                    SuspectBlip.Delete();
                                }
                            }
                        }
                        msg = "Control, the driver's ";
                        if (SuspectState == SuspectStates.Arrested)
                        {
                            msg += "~g~under arrest.";
                        }
                        else if (SuspectState == SuspectStates.Dead)
                        {
                            msg += "~o~dead.";
                        }
                        else if (SuspectState == SuspectStates.Escaped)
                        {
                            msg += "~r~escaped.";
                        }

                        msg += "~s~ The passenger's ";
                        if (PassengerState == SuspectStates.Arrested)
                        {
                            msg += "~g~under arrest.";
                        }
                        else if (PassengerState == SuspectStates.Dead)
                        {
                            msg += "~o~dead.";
                        }
                        else if (PassengerState == SuspectStates.Escaped)
                        {
                            msg += "~r~escaped.";
                        }
                        msg += "~s~ I'm state 2, over.";
                    }
                    DisplayCodeFourMessage();
                }
                catch (System.Threading.ThreadAbortException e)
                {
                    End();
                }
                catch (Exception e)
                {
                    if (CalloutRunning)
                    {
                        Game.LogTrivial(e.ToString());
                        Game.LogTrivial("British Policing Script handled the exception successfully.");
                        Game.DisplayNotification("~O~Failtostop~s~ callout crashed, sorry. Please send me your log file.");
                        Game.DisplayNotification("Full LSPDFR crash prevented ~g~successfully.");
                        End();
                    }
                }
            });
        }
Beispiel #8
0
        private void CalloutHandler()
        {
            CalloutRunning = true;
            GameFiber.StartNew(delegate
            {
                try
                {
                    SuspectCar = new Vehicle(GroundVehiclesToSelectFrom[EntryPoint.rnd.Next(GroundVehiclesToSelectFrom.Length)], sp, sp);
                    SuspectCar.IsPersistent = true;
                    Suspect = SuspectCar.CreateRandomDriver();
                    Suspect.MakeMissionPed();
                    SuspectBritishPersona             = BritishPersona.GetBritishPersona(Suspect);
                    SuspectCarRecords                 = VehicleRecords.GetVehicleRecords(SuspectCar);
                    SuspectCarRecords.RegisteredOwner = BritishPersona.GetRandomBritishPersona();
                    SuspectCarRecords.AddCustomFlag("~r~WANTED FOR TWOC ");
                    Suspect.Tasks.CruiseWithVehicle(20f, VehicleDrivingFlags.DriveAroundVehicles | VehicleDrivingFlags.DriveAroundObjects | VehicleDrivingFlags.AllowMedianCrossing | VehicleDrivingFlags.YieldToCrossingPedestrians);
                    GameFiber.Wait(2000);
                    Game.DisplayNotification("~b~Control: ~s~TWOC report's on a ~b~" + SuspectCarRecords.CarColour + "~b~ " + SuspectCarRecords.ModelName + "~s~. Licence plate: ~b~" + SuspectCarRecords.LicencePlate + ".");
                    GameFiber.Wait(4000);
                    Game.DisplayNotification("Vehicle has just been taken from ~b~" + World.GetStreetName(SuspectCar.Position) + "~s~. ~b~" + SuspectCarRecords.LicencePlate + "~s~ added to ~o~ANPR system.");
                    GameFiber.Wait(2000);
                    Game.DisplayHelp("Locate and stop the suspect's vehicle.");
                    HandleSearchForVehicleWithANPR();
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (!Game.LocalPlayer.Character.IsInAnyVehicle(false))
                        {
                            break;
                        }
                        if (Functions.IsPlayerPerformingPullover())
                        {
                            if (Functions.GetPulloverSuspect(Functions.GetCurrentPullover()) == Suspect)

                            {
                                break;
                            }
                        }
                    }
                    if (Functions.IsPlayerPerformingPullover())
                    {
                        GameFiber.Wait(4000);
                    }
                    if (SuspectBlip.Exists())
                    {
                        SuspectBlip.Delete();
                    }
                    if ((EntryPoint.rnd.Next(11) <= 6) || (!Game.LocalPlayer.Character.IsInAnyVehicle(false)))
                    {
                        Pursuit = Functions.CreatePursuit();
                        Functions.AddPedToPursuit(Pursuit, Suspect);
                        Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
                        if (Functions.IsPlayerPerformingPullover())
                        {
                            Functions.ForceEndCurrentPullover();
                        }
                        Functions.PlayScannerAudioUsingPosition("WE_HAVE CRIME_RESIST_ARREST IN_OR_ON_POSITION", Game.LocalPlayer.Character.Position);

                        Game.DisplayNotification("Control, the vehicle is ~r~making off.~b~ Giving chase.");


                        while (Functions.IsPursuitStillRunning(Pursuit))
                        {
                            GameFiber.Yield();
                            if (!CalloutRunning)
                            {
                                break;
                            }
                        }
                    }
                    else
                    {
                        while (CalloutRunning)
                        {
                            GameFiber.Yield();
                            if (!Game.LocalPlayer.Character.IsInAnyVehicle(false))
                            {
                                GameFiber.Wait(1000);
                                if (EntryPoint.rnd.Next(5) == 0)
                                {
                                    Pursuit = Functions.CreatePursuit();
                                    Functions.AddPedToPursuit(Pursuit, Suspect);
                                    Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
                                    if (Functions.IsPlayerPerformingPullover())
                                    {
                                        Functions.ForceEndCurrentPullover();
                                    }

                                    Functions.PlayScannerAudioUsingPosition("WE_HAVE CRIME_RESIST_ARREST IN_OR_ON_POSITION", Game.LocalPlayer.Character.Position);

                                    Game.DisplayNotification("Control, the vehicle is ~r~making off.~b~ Giving chase.");
                                }
                                break;
                            }
                        }
                        while (CalloutRunning)
                        {
                            GameFiber.Yield();
                            if (Suspect.Exists())
                            {
                                if (Functions.IsPedArrested(Suspect))
                                {
                                    break;
                                }
                                if (Suspect.IsDead)
                                {
                                    break;
                                }
                            }
                            else
                            {
                                break;
                            }
                        }
                    }
                    if (Suspect.Exists())
                    {
                        if (Functions.IsPedArrested(Suspect))
                        {
                            msg = "Control, suspect is ~g~under arrest. ~s~Show me state 2, over.";
                            int HoursUnpaidWork = (int)Math.Round(((float)EntryPoint.rnd.Next(100, 200)) / 5.0f) * 5;
                            int Costs           = (int)Math.Round(((float)EntryPoint.rnd.Next(86)) / 5.0f) * 5;
                            string sentence     = " Community order made with " + HoursUnpaidWork.ToString() + " hours unpaid work. Disqualified from driving for " + EntryPoint.rnd.Next(4, 13).ToString() + " months. " + Costs.ToString() + " pounds in costs.";
                            CourtSystem.CreateNewCourtCase(SuspectBritishPersona, "taking a vehicle without the owner's consent", 100, sentence);
                        }
                        else if (Suspect.IsDead)
                        {
                            msg = "Control, suspect is ~r~dead. ~s~Show me state 2, over";
                        }
                    }
                    else
                    {
                        msg = "Control, the suspects ~r~have escaped. ~s~Show me state 2, over";
                    }
                    DisplayCodeFourMessage();
                }
                catch (System.Threading.ThreadAbortException e)
                {
                    End();
                }
                catch (Exception e)
                {
                    if (CalloutRunning)
                    {
                        Game.LogTrivial(e.ToString());
                        Game.LogTrivial("British Policing Script handled the exception successfully.");
                        Game.DisplayNotification("~O~TWOC~s~ callout crashed, sorry. Please send me your log file.");
                        Game.DisplayNotification("Full LSPDFR crash prevented ~g~successfully.");
                        End();
                    }
                }
            });
        }
Beispiel #9
0
        public override void End()
        {
            CalloutRunning = false;
            Rage.Native.NativeFunction.Natives.RESET_AI_MELEE_WEAPON_DAMAGE_MODIFIER();
            if (Game.LocalPlayer.Character.Exists())
            {
                if (Game.LocalPlayer.Character.IsDead)
                {
                    GameFiber.Wait(1500);
                    Functions.PlayScannerAudio("OFFICER HAS_BEEN_FATALLY_SHOT NOISE_SHORT OFFICER_NEEDS_IMMEDIATE_ASSISTANCE");
                    GameFiber.Wait(3000);
                }
            }
            else
            {
                GameFiber.Wait(1500);
                Functions.PlayScannerAudio("OFFICER HAS_BEEN_FATALLY_SHOT NOISE_SHORT OFFICER_NEEDS_IMMEDIATE_ASSISTANCE");
                GameFiber.Wait(3000);
            }
            base.End();

            if (PoliceOfficerBlip.Exists())
            {
                PoliceOfficerBlip.Delete();
            }

            if (CalloutFinished)
            {
                if (PoliceOfficer.Exists())
                {
                    PoliceOfficer.Dismiss();
                }
                if (PoliceCar.Exists())
                {
                    PoliceCar.Dismiss();
                }
                if (Suspect.Exists())
                {
                    if (!Suspect.IsInAnyVehicle(false))
                    {
                        Suspect.Dismiss();
                    }
                    else
                    {
                        if (Suspect.CurrentVehicle.Driver == Suspect)
                        {
                            Suspect.Dismiss();
                        }
                        else
                        {
                            Suspect.Delete();
                        }
                    }
                }
                if (SuspectCar.Exists())
                {
                    SuspectCar.Dismiss();
                }
            }
            else
            {
                if (PoliceCar.Exists())
                {
                    PoliceCar.Delete();
                }


                if (PoliceOfficer.Exists())
                {
                    PoliceOfficer.Delete();
                }
                if (Suspect.Exists())
                {
                    Suspect.Delete();
                }
                if (SuspectCar.Exists())
                {
                    SuspectCar.Delete();
                }
            }
        }
Beispiel #10
0
        private void MainLogic()
        {
            CalloutRunning = true;
            GameFiber.StartNew(delegate
            {
                try
                {
                    DispatchResponse();
                    WaitForGetClose();
                    WaitForParkAndGetNearby();
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        PoliceCar.ShouldVehiclesYieldToThisVehicle = false;
                        if (Vector3.Distance(Game.LocalPlayer.Character.Position, PoliceOfficer.Position) < 4f)
                        {
                            Game.DisplayHelp("Press ~b~" + AssortedCalloutsHandler.kc.ConvertToString(AssortedCalloutsHandler.TalkKey) + " ~s~to talk.");
                            if (Albo1125.Common.CommonLibrary.ExtensionMethods.IsKeyDownComputerCheck(AssortedCalloutsHandler.TalkKey))
                            {
                                SpeechHandler.HandleSpeech("Officer", ArrestWarrantSpeeches[AssortedCalloutsHandler.rnd.Next(ArrestWarrantSpeeches.Count)]);
                                PoliceOfficer.Tasks.EnterVehicle(PoliceCar, 5000, -1);
                                break;
                            }
                        }
                    }
                    if (CalloutRunning)
                    {
                        if (Suspect.IsInAnyVehicle(false))
                        {
                            Suspect.Tasks.LeaveVehicle(LeaveVehicleFlags.None).WaitForCompletion(3000);
                        }
                    }
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        Suspect.Tasks.FollowNavigationMeshToPosition(Game.LocalPlayer.Character.GetOffsetPosition(Vector3.RelativeBack * 1.5f), Game.LocalPlayer.Character.Heading, 1.4f).WaitForCompletion(500);
                        if (Game.LocalPlayer.Character.LastVehicle.Exists())
                        {
                            if (Game.LocalPlayer.Character.LastVehicle.DistanceTo(Suspect) < 3f)
                            {
                                Suspect.Tasks.Clear();
                                Suspect.Tasks.EnterVehicle(Game.LocalPlayer.Character.LastVehicle, 6000, Game.LocalPlayer.Character.LastVehicle.PassengerCapacity - 1).WaitForCompletion(6100);
                            }
                        }
                        if (Suspect.IsInAnyVehicle(false))
                        {
                            break;
                        }
                    }
                    if (SuspectBlip.Exists())
                    {
                        SuspectBlip.Delete();
                    }
                    if (PoliceOfficerBlip.Exists())
                    {
                        PoliceOfficerBlip.Delete();
                    }

                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (Suspect.Exists())
                        {
                            if (Functions.IsPedInPrison(Suspect))
                            {
                                break;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                    DisplayCodeFourMessage();
                }
                catch (System.Threading.ThreadAbortException e)
                {
                    End();
                }
                catch (Exception e)
                {
                    if (CalloutRunning)
                    {
                        Game.LogTrivial(e.ToString());
                        Game.LogTrivial("Assorted Callouts handled the exception successfully.");
                        Game.DisplayNotification("~O~Traffic Stop Backup~s~callout crashed, sorry. Please send me your log file.");
                        Game.DisplayNotification("Full LSPDFR crash prevented ~g~successfully.");
                        End();
                    }
                }
            });
        }