//private static WMPLib.WindowsMediaPlayer wmp2 = new WMPLib.WindowsMediaPlayer();
 public static void PlayPhoneCallingSound(int TimesToPlay)
 {
     for (int i = 0; i < TimesToPlay; i++)
     {
         wmp1.settings.volume = 100;
         wmp1.URL             = "LSPDFR/audio/scanner/Assorted Callouts Audio/PHONE_CALLING.wav";
         GameFiber.Wait(3000);
     }
 }
Exemple #2
0
        public void IssueTicket(bool SeizeVehicle)
        {
            GameFiber.StartNew(delegate
            {
                Game.LocalPlayer.Character.Tasks.AchieveHeading(Game.LocalPlayer.Character.CalculateHeadingTowardsEntity(Suspect));
                Functions.GetPersonaForPed(Suspect).Citations++;
                GameFiber.Wait(1500);
                Game.LocalPlayer.Character.Tasks.Clear();
                NativeFunction.Natives.TASK_START_SCENARIO_IN_PLACE(Game.LocalPlayer.Character, "CODE_HUMAN_MEDIC_TIME_OF_DEATH", 0, true);

                //Do animation
                while (!NativeFunction.Natives.IS_PED_ACTIVE_IN_SCENARIO <bool>(Game.LocalPlayer.Character))
                {
                    GameFiber.Yield();
                }
                int Waitcount = 0;
                while (NativeFunction.Natives.IS_PED_ACTIVE_IN_SCENARIO <bool>(Game.LocalPlayer.Character))
                {
                    GameFiber.Yield();
                    Waitcount++;
                    if (Waitcount >= 300)
                    {
                        Game.LocalPlayer.Character.Tasks.Clear();
                    }
                }
                GameFiber.Wait(4000);

                if (SeizeVehicle && SuspectVehicle.Exists())
                {
                    //Game.LogTrivial("Debug 4");
                    foreach (Ped occupant in SuspectVehicle.Occupants)
                    {
                        occupant.Tasks.LeaveVehicle(LeaveVehicleFlags.None).WaitForCompletion(6000);
                        if (occupant.IsInAnyVehicle(false))
                        {
                            occupant.Tasks.LeaveVehicle(LeaveVehicleFlags.WarpOut).WaitForCompletion(100);
                        }
                        occupant.Tasks.Wander();
                    }

                    GameFiber.Wait(1000);
                    Game.LocalPlayer.Character.Tasks.ClearImmediately();
                    if (LSPDFRPlusHandler.ArrestManagerRunning)
                    {
                        API.ArrestManagerFuncs.RequestTowForVeh(SuspectVehicle);
                    }
                }
                else
                {
                    GameFiber.Wait(2500);
                    Functions.ForceEndCurrentPullover();
                }

                StatisticsCounter.AddCountToStatistic("Traffic Stop - Tickets Issued", "LSPDFR+");
            });
        }
        public override void Process()
        {
            base.Process();

            if (Game.IsKeyDown(System.Windows.Forms.Keys.End))
            {
                Game.LogTrivial("(Naked Person): Callout *ENDED*. User pressed END.");

                Functions.PlayScannerAudio(MathHelper.Choose(NotiffSound));
                Game.DisplayNotification("~g~Code 4~w~, return to patrol.");
                Functions.PlayScannerAudio(MathHelper.Choose(PTTAudio));
                Functions.PlayScannerAudio("ATTENTION_ALL_UNITS WE_ARE_CODE_4");
                Functions.PlayScannerAudio(MathHelper.Choose(End3rdPRTAudio));
                End();
            }

            if (Game.LocalPlayer.Character.DistanceTo(Suspect.Position) < 20f && hasArrived == false)
            {
                Game.LogTrivial("(NakedPerson): Officer Arrived At Scene");
                Functions.PlayScannerAudio(MathHelper.Choose(NotiffSound));
                Game.DisplayHelp("Press ~p~Y~w~ when you reach the ~y~Suspect~w~ to talk with him.");
                hasArrived        = true;
                IsSpeechFinished = false;
            }

            if (IsSpeechFinished == false && Game.LocalPlayer.Character.DistanceTo(Suspect.Position) < 5f)
            {
                while (!Game.IsKeyDown(System.Windows.Forms.Keys.Y))
                {
                    GameFiber.Yield();
                }


                Suspect.Tasks.Clear();
                Suspect.Tasks.StandStill(30000);

                Game.DisplaySubtitle("~b~Officer~w~: Hello! What's going on? Are you the caller?", 4000);
                GameFiber.Wait(4500);
                Game.DisplaySubtitle("~o~Suspect~w~: I don't know anything officer. What's happening?", 3500);
                GameFiber.Wait(4000);
                Game.DisplaySubtitle("~b~Officer~w~: We got a call for an incident exposure on this exact location. Have you seen anyone? ", 4000);
                GameFiber.Wait(4500);
                Game.DisplaySubtitle("~o~Suspect~w~: Unfortunately no Officer. Sorry. As you can see, no one here is ~y~naked~w~.. It must have been a prank call...", 3500);
                GameFiber.Wait(4000);
                Game.DisplaySubtitle("~b~Officer~w~: Yes. That's how it looks like.", 4000);
                GameFiber.Wait(4500);
                Game.DisplaySubtitle("~b~Officer~w~: Alright. Thank you for your time. Have a nice day!", 4000);
                GameFiber.Wait(4500);
                Game.DisplaySubtitle("~o~Suspect~w~: Thank you ~b~Officer~w~! Take care!", 3500);
                IsSpeechFinished = true;
                GameFiber.Wait(4500);

                Functions.PlayScannerAudio("NOTIF_SOUND");
                Game.DisplayHelp("You can now press ~b~END~w~ to become ~g~available~w~.");
            }
        }
Exemple #4
0
 public void IssueWarning()
 {
     GameFiber.StartNew(delegate
     {
         PlaySpecificSpeech("Warn");
         GameFiber.Wait(2500);
         Functions.ForceEndCurrentPullover();
         StatisticsCounter.AddCountToStatistic("Traffic Stop - Warnings Issued", "LSPDFR+");
     });
 }
        public static void PlayPhoneBusySound(int TimesToPlay)
        {
            for (int i = 0; i < TimesToPlay; i++)
            {
                wmp1.settings.volume = 100;
                wmp1.URL             = "LSPDFR/Police Scanner/Assorted Callouts Audio/PHONE_BUSY.wav";

                GameFiber.Wait(800);
            }
        }
Exemple #6
0
 internal static void Initialise()
 {
     Game.LogTrivial("PoliceSmartRadio, developed by Albo1125, has been loaded successfully!");
     GameFiber.StartNew(delegate
     {
         GameFiber.Wait(6000);
         Game.DisplayNotification("~b~PoliceSmartRadio~s~, developed by ~b~Albo1125, ~s~has been loaded ~g~successfully.");
     });
     MainLogic();
 }
 internal static void Initialise()
 {
     Game.LogTrivial("PoliceSmartRadio-LITE has been loaded successfully!");
     GameFiber.StartNew(delegate
     {
         GameFiber.Wait(100);
         Game.DisplayNotification("PoliceSmartRadio-LITE~n~~y~v" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + "-LITE~o~ by FAC851~n~(original by Albo1125)~n~~b~has been loaded. ~g~Enjoy!");
     });
     MainLogic();
 }
Exemple #8
0
        private void Initialize()
        {
            Game.FadeScreenOut(0);
            GameFiber.Wait(1000);

            Log.Info("Intializing AsiSupport version " + this.Version + "...");
            Log.Info("Using PursuitLib " + typeof(Log).GetVersion());
            Log.Info("Using PursuitLib.RPH " + typeof(RPHPlugin).GetVersion());

            ResourceManager.RegisterProvider("data", new DirectoryResourceProvider(this.DataDirectory));
            this.EnsureResourcesAvailable();
            if (this.IsStopped)
            {
                return;
            }

            ManifestFile gameVersions = new ManifestFile(Path.Combine(this.DataDirectory, "Versions.manifest"));
            string       versionStr   = Game.ProductVersion.ToString();
            bool         isSteamVer   = File.Exists("steam_api64.dll");

            for (int i = 0; i < gameVersions.Entries.Count; i++)
            {
                string entry   = gameVersions.Entries[i];
                bool   isSteam = entry[0] == 's';
                string version = entry.Substring(1);

                if (isSteam == isSteamVer && versionStr == version)
                {
                    this.GameVersion = i;
                    break;
                }
            }

            this.Loader          = new AsiLoader(Path.Combine("", "AsiPlugins"));
            this.TextureManager  = new TextureManager();
            this.KeyboardManager = new KeyboardManager();
            AsiInterface.Initialize();

            Log.Info("AsiSupport initialized.");

            if (this.Config.LoadAllPluginsOnStartup)
            {
                this.Loader.LoadAllPlugins();
            }

            if (this.Config.EnableSHVDNSupport)
            {
                SHVDN.Init();
            }

            Log.Info("All scripts are loaded. Fading screen back in...");

            Game.FadeScreenIn(1000);
            this.initialized = true;
        }
Exemple #9
0
 internal static void Initialize()
 {
     GameFiber.StartNew(delegate
     {
         Game.LogTrivial("AM+: Loaded ArrestManager+, phase 2");
         GameFiber.Wait(6000);
         Game.DisplayNotification("web_lossantospolicedept", "web_lossantospolicedept", "ArrestManager+", "Loaded", "");
     });
     Game.LogTrivial("AM+: ArrestManager+ done loading");
     Choice();
 }
Exemple #10
0
        public static void BetaCheck()
        {
            GameFiber.StartNew(delegate
            {
                Game.LogTrivial("British Policing Script, developed by Albo1125, has been loaded successfully!");
                GameFiber.Wait(6000);
                Game.DisplayNotification("~b~British Policing Script~s~, developed by ~b~Albo1125, ~s~has been loaded ~g~successfully.");
            });

            MainLoop();
        }
Exemple #11
0
        public override void Process()
        {
            base.Process();
            if (MainScenario == 0)
            {
                while (Game.LocalPlayer.Character.DistanceTo(MainSpawnPoint) >= 125f && !Game.IsKeyDown(System.Windows.Forms.Keys.End))
                {
                    MainTrafficBreak = World.AddSpeedZone(MainSpawnPoint, 125, 12f);    //Add a speedzone when the player gets within 125m of the scene.
                    GameFiber.Wait(0);
                }
                if (Game.IsKeyDown(System.Windows.Forms.Keys.End))
                {
                    End();  //End the callout if player presses 'End' before reaching scene
                }
                while (Game.LocalPlayer.Character.DistanceTo(MainSpawnPoint) <= 125f)
                {
                    Game.LogTrivial("YOBBINCALLOUTS: Player is On Scene.");
                    Game.DisplaySubtitle("Press 'Y' to ~g~Start~w~ the Traffic Break.", 2000);
                    while (InstructionsCount < Instructions.Count)
                    {
                        GameFiber.Yield();
                        if (Game.IsKeyDown(System.Windows.Forms.Keys.Y))
                        {
                            Game.DisplaySubtitle(Instructions[InstructionsCount]);
                            InstructionsCount++;
                        }
                    }
                    GameFiber.Wait(1000);
                    Game.DisplayNotification("Dispatch, We are Starting the ~y~Traffic Break.");
                    AccidentLocation        = new Vector3(-2091.691f, -446.1866f, 11.36965f);
                    Accident                = new Blip(AccidentLocation, 20);
                    Accident.Color          = System.Drawing.Color.Yellow;
                    Accident.IsRouteEnabled = true;
                    GameFiber.Wait(1000);
                    Area.Delete();
                    World.RemoveSpeedZone(MainTrafficBreak);
                    GameFiber.Wait(500);
                    break;
                }
                while (!Game.IsKeyDown(Keys.End))
                {
                    MainTrafficBreak = World.AddSpeedZone(Game.LocalPlayer.Character.Position, 125, 12f);
                    GameFiber.Wait(0);
                }
                GameFiber.Wait(2000);
                Game.DisplayNotification("Dispatch, Traffic Break ~r~Over. ~y~Traffic Moving Back to Normal.");
                GameFiber.Wait(3000);
                Functions.PlayScannerAudio("REPORT_RESPONSE_COPY_02");
                Area.Delete();

                GameFiber.Wait(1000);
                End();
            }
        }
Exemple #12
0
        /// <summary>
        /// Suicides this Rage.Ped instance with a pill
        /// </summary>
        /// <param name="ped"></param>
        public static void SuicidePill(this Ped ped)
        {
            ped.Tasks.PlayAnimation("mp_suicide", "pill", 1.336f, AnimationFlags.None);

            GameFiber.Wait(2250);

            if (ped.IsPlayingAnimation("mp_suicide", "pill"))
            {
                ped.Kill();
            }
        }
 // Token: 0x06000031 RID: 49 RVA: 0x00005E54 File Offset: 0x00004054
 internal void DistanceWatcher_EMS()
 {
     while (EManager.currentCallState != EManager.CallState.Arrived)
     {
         if (Vector3.Distance(Ambulance_Escort_Bollingbrook_to_Davis.limo.Position, Ambulance_Escort_Bollingbrook_to_Davis.prota.Position) > 40f && EManager.currentCallState != EManager.CallState.Parking)
         {
             Game.DisplaySubtitle("Stay close to the convoy to keep the team formation.", 3000);
             GameFiber.Wait(3000);
         }
         GameFiber.Yield();
     }
 }
        public static void Main()
        {
            GameFiber.StartNew(delegate
            {
                try
                {
                    Vehicle vehicleToCheck = Game.LocalPlayer.Character.IsInAnyVehicle(false) ? InCar() : OnFoot();
                    if (vehicleToCheck.Exists())
                    {
                        if (vehicleToCheck.IsTrailer)
                        {
                            vehicleToCheck = ((Vehicle[])World.GetEntities(vehicleToCheck.GetOffsetPositionFront(5), 15, GetEntitiesFlags.ConsiderAllVehicles | GetEntitiesFlags.ExcludePlayerVehicle)).
                                             FirstOrDefault(x => x.HasTrailer && x.Trailer == vehicleToCheck);
                            if (!vehicleToCheck)
                            {
                                return;
                            }
                        }
                        vehCurrentlyBeingChecked = vehicleToCheck;
                        PlateChecker checker;
                        if (AllVehiclesChecked.ContainsKey(vehicleToCheck))
                        {
                            checker = AllVehiclesChecked[vehicleToCheck];
                        }
                        else
                        {
                            checker = new PlateChecker(vehicleToCheck);
                        }
                        Game.DisplayNotification("~b~" + PoliceSmartRadio.PlayerName + ": ~s~Dispatch, can you do a plate check for me? It's " + checker.modelArticle + " ~b~" + checker.vehModel + "~s~, plate ~b~" + checker.LicencePlate + ".");
                        GameFiber.Wait(2000);
                        Game.DisplayNotification("~b~Dispatch: ~s~Copy that, stand by for the plate check...");
                        GameFiber.Wait(4000);
                        GameFiber.StartNew(checker.PlayAudio);
                        GameFiber.Wait(500);

                        Game.DisplayNotification("~b~Dispatch: ~s~" + PoliceSmartRadio.PlayerName + ", plate check: ~n~~b~Plate: " + checker.LicencePlate + "~n~Model: " + checker.vehModel
                                                 + "~n~Reg. Year: " + checker.vehicleYear + "~n~Registered Owner: ~y~" + checker.DriverPersona.FullName + "~b~~n~Citations: " + checker.DriverPersona.Citations);
                        GameFiber.Wait(2000);
                        Game.DisplayNotification(checker.Flags);
                        if (vehCurrentlyBeingChecked == vehicleToCheck)
                        {
                            vehCurrentlyBeingChecked = null;
                        }
                    }
                }
                catch (Exception e)
                {
                    Game.LogTrivial(e.ToString());
                    Game.DisplayNotification("Whoops! Police SmartRadio plate check encountered an error. Please send your RAGEPluginHook.log file to the author (Albo1125).");
                    Game.LogTrivial("PoliceSmartRadio handled the PlateCheck exception.");
                }
            });
        }
Exemple #15
0
 public override void Process()
 {
     GameFiber.StartNew(delegate
     {
         if (_subject.DistanceTo(Game.LocalPlayer.Character) < 20f)
         {
             if (_IsStolen == true && _startedPursuit == false)
             {
                 if (_Blip.Exists())
                 {
                     _Blip.Delete();
                 }
                 _pursuit = Functions.CreatePursuit();
                 Functions.AddPedToPursuit(_pursuit, _subject);
                 Functions.SetPursuitIsActiveForPlayer(_pursuit, true);
                 _startedPursuit = true;
                 _Bike.IsStolen  = true;
                 Game.DisplayNotification("web_lossantospolicedept", "web_lossantospolicedept", "~w~DutchCallouts Computer", "~y~Meldkamer Informatie", "De ~g~fiets~w~ van de verdachte is een ~o~" + _Bike.Model.Name + "~w~. De ~g~fiets~w~ is ~r~gestolen~w~!");
                 GameFiber.Wait(2000);
             }
             if (_subject.DistanceTo(Game.LocalPlayer.Character) < 25f && Game.LocalPlayer.Character.IsOnFoot && _alreadySubtitleIntrod == false && _pursuit == null)
             {
                 Game.DisplayNotification("Doe een normale aanhouding van de ~o~verdachte~w~.");
                 Game.DisplayNotification("~b~Meldkamer:~w~ Serienummer controleren.....");
                 GameFiber.Wait(600);
                 Game.DisplayNotification("~b~Meldkamer:~w~ We hebben het serienummer van de fiets nagetrokken.<br>Model: ~o~" + _Bike.Model.Name + "<br>~w~Serienummer: ~o~" + _Bike.LicensePlate + "");
                 _alreadySubtitleIntrod = true;
                 return;
             }
         }
         if (_subject.Exists() && Functions.IsPedArrested(_subject) && _IsStolen && _subject.DistanceTo(Game.LocalPlayer.Character) < 15f)
         {
             Game.DisplaySubtitle("~y~Verdachte: ~w~Laat me alsjeblieft gaan! ik breng de fiets direct terug!", 4000);
         }
         if (Game.LocalPlayer.Character.IsDead)
         {
             End();
         }
         if (Game.IsKeyDown(Settings.EndCall))
         {
             End();
         }
         if (_subject.IsDead)
         {
             End();
         }
         if (Functions.IsPedArrested(_subject))
         {
             End();
         }
     }, "FietserSW [DutchCallouts]");
     base.Process();
 }
Exemple #16
0
 internal static void Initialise()
 {
     GameFiber.StartNew(delegate
     {
         Game.LogTrivial("Assorted Callouts, developed by Albo1125, has been loaded successfully!");
         GameFiber.Wait(6000);
         Game.DisplayNotification("~b~Assorted Callouts~s~, developed by ~b~Albo1125, ~s~has been loaded ~g~successfully.");
     });
     Game.LogTrivial("Assorted Callouts is not in beta.");
     LoadInitialisationFileValues();
     RegisterCallouts();
 }
        public static void BetaCheck()
        {
            GameFiber.StartNew(delegate
            {
                Game.LogTrivial("LSPDFR+, developed by Albo1125, has been loaded successfully!");
                GameFiber.Wait(6000);
                Game.DisplayNotification("~b~LSPDFR+~s~, developed by ~b~Albo1125, ~s~has been loaded ~g~successfully.");
            });
            Game.LogTrivial("LSPDFR+ is not in beta.");

            MainLoop();
        }
        public override bool OnCalloutAccepted()
        {
            SpawnLocationBlip        = new Blip(_Cop1);
            SpawnLocationBlip.Color  = Color.LightGreen;
            SpawnLocationBlip.Sprite = BlipSprite.PointOfInterest;
            SpawnLocationBlip.EnableRoute(Color.LightBlue);

            Functions.PlayScannerAudioUsingPosition("ATTENTION_GENERIC_01 UNITS WE_HAVE A_01 CRIME_DEAD_BODY_01 CODE3", _DeadPersonSpawn);
            Game.DisplayNotification("web_lossantospolicedept", "web_lossantospolicedept", "~w~UnitedCallouts", "~y~Murder Investigation", "~b~Dispatch: ~w~The police department needs a ~b~detective~w~ on scene to find and arrest the murder. Respond with ~r~Code 3");
            GameFiber.Wait(2000);
            return(base.OnCalloutAccepted());
        }
Exemple #19
0
 public override void Process()
 {
     GameFiber.StartNew(delegate
     {
         if (_subject.DistanceTo(Game.LocalPlayer.Character) < 20f)
         {
             if (_IsStolen == true && _startedPursuit == false)
             {
                 if (_Blip)
                 {
                     _Blip.Delete();
                 }
                 _pursuit = Functions.CreatePursuit();
                 Functions.AddPedToPursuit(_pursuit, _subject);
                 Functions.SetPursuitIsActiveForPlayer(_pursuit, true);
                 _startedPursuit = true;
                 _Bike.IsStolen  = true;
                 Game.DisplayNotification("web_lossantospolicedept", "web_lossantospolicedept", "~w~UnitedCallouts", "~y~Dispatch Information", "The ~g~bicycle~w~ from the suspect is a ~o~" + _Bike.Model.Name + "~w~. The ~g~bicycle~w~ was ~r~stolen~w~.");
                 GameFiber.Wait(2000);
             }
             if (_subject.DistanceTo(Game.LocalPlayer.Character) < 25f && Game.LocalPlayer.Character.IsOnFoot && _alreadySubtitleIntrod == false && _pursuit == null)
             {
                 Game.DisplayNotification("Perform a normal traffic stop with the ~o~suspect~w~.");
                 Game.DisplayNotification("~b~Dispatch:~w~ Checking the serial number of the bike...");
                 GameFiber.Wait(2000);
                 Game.DisplayNotification("~b~Dispatch~w~ We checked the serial number of the bike.<br>Model: ~o~" + _Bike.Model.Name + "<br>~w~Serial number: ~o~" + _Bike.LicensePlate);
                 _alreadySubtitleIntrod = true;
                 return;
             }
         }
         if (_subject && Functions.IsPedArrested(_subject) && _IsStolen && _subject.DistanceTo(Game.LocalPlayer.Character) < 15f)
         {
             Game.DisplaySubtitle("~y~Suspect: ~w~Please let me go! I bring the bike back.", 4000);
         }
         if (Game.LocalPlayer.Character.IsDead)
         {
             End();
         }
         if (Game.IsKeyDown(Settings.EndCall))
         {
             End();
         }
         if (_subject && _subject.IsDead)
         {
             End();
         }
         if (_subject && Functions.IsPedArrested(_subject))
         {
             End();
         }
     }, "Bicycle on the Freeway [UnitedCallouts]");
     base.Process();
 }
Exemple #20
0
        internal static void Initialise()
        {
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(LSPDFRResolveEventHandler);

            GameFiber.StartNew(delegate
            {
                Game.LogTrivial("Custom Pullover has been loaded successfully! [CustomPulloverHandler.cs-201]");
                GameFiber.Wait(6000);
                Game.DisplayNotification("~b~Custom Pullover~b~ " + Assembly.GetExecutingAssembly().GetName().Version.ToString());
                MainLoop();
            });
        }
Exemple #21
0
 public override void Process()
 {
     GameFiber.StartNew(delegate
     {
         if (_subject.DistanceTo(Game.LocalPlayer.Character.GetOffsetPosition(Vector3.RelativeFront)) < 25f && !_isArmed)
         {
             _subject.Inventory.GiveNewWeapon(new WeaponAsset(wepList[new Random().Next((int)wepList.Length)]), 500, true);
             _isArmed = true;
         }
         if (_subject.Exists() && _subject.DistanceTo(Game.LocalPlayer.Character.GetOffsetPosition(Vector3.RelativeFront)) < 25f && !_hasBegunAttacking)
         {
             if (_scenario > 40)
             {
                 _subject.KeepTasks = true;
                 _subject.Tasks.FightAgainst(Game.LocalPlayer.Character);
                 _hasBegunAttacking = true;
                 GameFiber.Wait(2000);
             }
             else
             {
                 if (!_hasPursuitBegun)
                 {
                     if (_Blip.Exists())
                     {
                         _Blip.Delete();
                     }
                     _pursuit = Functions.CreatePursuit();
                     Functions.AddPedToPursuit(_pursuit, _subject);
                     Functions.SetPursuitIsActiveForPlayer(_pursuit, true);
                     _hasPursuitBegun = true;
                 }
             }
         }
         if (Game.LocalPlayer.Character.IsDead)
         {
             End();
         }
         if (Game.IsKeyDown(Settings.EndCall))
         {
             End();
         }
         if (_subject.IsDead)
         {
             End();
         }
         if (Functions.IsPedArrested(_subject))
         {
             End();
         }
     }, "KillerClown was seen [UnitedCallouts]");
     base.Process();
 }
Exemple #22
0
 public override void Process()
 {
     GameFiber.StartNew(delegate
     {
         if (_A1.DistanceTo(Game.LocalPlayer.Character) < 25f)
         {
             if (_Scene1 == true && !_hasBegunAttacking)
             {
                 _A1.Tasks.FightAgainstClosestHatedTarget(1000f);
                 _A2.Tasks.FightAgainstClosestHatedTarget(1000f);
                 _A1.Tasks.FightAgainst(Game.LocalPlayer.Character);
                 _A2.Tasks.FightAgainst(Game.LocalPlayer.Character);
                 GameFiber.Wait(2000);
                 _hasBegunAttacking = true;
             }
             else if (_Scene2 == true && !_notificationDisplayed && !_check)
             {
                 _A1.Tasks.FightAgainstClosestHatedTarget(1000f);
                 _A2.Tasks.FightAgainstClosestHatedTarget(1000f);
                 _A1.Tasks.FightAgainst(Game.LocalPlayer.Character);
                 _A2.Tasks.FightAgainst(Game.LocalPlayer.Character);
                 GameFiber.Wait(2000);
                 _hasBegunAttacking = true;
             }
             else if (_Scene3 == true && !_pursuitCreated)
             {
                 _pursuit = Functions.CreatePursuit();
                 Functions.AddPedToPursuit(_pursuit, _A1);
                 Functions.AddPedToPursuit(_pursuit, _A2);
                 Functions.SetPursuitIsActiveForPlayer(_pursuit, true);
                 _pursuitCreated = true;
             }
         }
         if (_A1 && _A1.IsDead && _A2 && _A2.IsDead)
         {
             End();
         }
         if (_A1 && Functions.IsPedArrested(_A1) && _A2 && Functions.IsPedArrested(_A2))
         {
             End();
         }
         if (Game.LocalPlayer.Character.IsDead)
         {
             End();
         }
         if (Game.IsKeyDown(Settings.EndCall))
         {
             End();
         }
     }, "Store Robbery [UnitedCallouts]");
     base.Process();
 }
        /// <summary>
        /// What to do if the player accepts the callout
        /// </summary>
        /// <returns></returns>
        public override bool OnCalloutAccepted()
        {
            int r1 = new Random().Next(1, 3);

            // Attach the blips
            B1 = V1.AttachBlip();

            B1.Color = Color.Red;

            // Shows the player to respond to the scene.
            Game.DisplaySubtitle("Get to the ~r~scene~w~.", 6500);
            B1.EnableRoute(Color.Red);

            // Wait 5 seconds and then display the notification
            GameFiber.StartNew(delegate
            {
                GameFiber.Wait(5000);

                Game.DisplayHelp("To end the callout press ~b~End~w~.");
            }, "waitingForNotification");


            // If the random is 1 then kill the driver if not keep him/her alive.

            V1.Kill();
            V1.MakePersistent();

            // Damage the vehicle so it looks better and like a crash
            car.MakePersistent();

            //NativeFunction.CallByName<uint>("SET_VEHICLE_DAMAGE", car, 1f, 1f, 1f, 1f, 30f, 15f, true);
            car.Deform(car.Position, 20f, 30f);
            car.EngineHealth   = 50f;
            car.FuelTankHealth = 650f;
            car.DirtLevel      = 3;
            car.AlarmTimeLeft  = new TimeSpan(0, 20, 0);
            car.SetRotationRoll(180f);

            NativeFunction.CallByName <uint>("SMASH_VEHICLE_WINDOW", car, 0);
            NativeFunction.CallByName <uint>("SMASH_VEHICLE_WINDOW", car, 1);
            NativeFunction.CallByName <uint>("SMASH_VEHICLE_WINDOW", car, -1);
            NativeFunction.CallByName <uint>("SET_VEHICLE_DOOR_OPEN", car, 5, true, true);
            NativeFunction.CallByName <uint>("SET_VEHICLE_DOOR_OPEN", car, 3, true, true);
            if (r1 == 1)
            {
                NativeFunction.CallByName <uint>("SET_VEHICLE_TYRE_BURST", car, 0, true, 1000);
                NativeFunction.CallByName <uint>("SET_VEHICLE_DOOR_BROKEN", car, 1, true);
                NativeFunction.CallByName <uint>("SET_VEHICLE_DOOR_BROKEN", car, 2, true);
            }

            return(base.OnCalloutAccepted());
        }
        internal static void Initialise()
        {
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(LSPDFRResolveEventHandler);

            GameFiber.StartNew(delegate
            {
                Game.LogTrivial("Traffic Policer is not in beta.");
                mainLoop();
                Game.LogTrivial("Traffic Policer, developed by Albo1125, has been loaded successfully!");
                GameFiber.Wait(6000);
                Game.DisplayNotification("~b~Traffic Policer~s~, developed by ~b~Albo1125, ~s~has been loaded ~g~successfully.");
            });
        }
Exemple #25
0
        public GameFiber StartNewFiber(int Delay, FiberDelegate_NoParams FiberDelegate)
        {
            GameFiber NewFiber = GameFiber.StartNew(delegate
            {
                while (true)
                {
                    GameFiber.Wait(Delay);
                    FiberDelegate();
                }
            });

            return(NewFiber);
        }
Exemple #26
0
        private static void MainLogic()
        {
            GameFiber.StartNew(() =>
            {
                while (true)
                {
                    GameFiber.Yield();

                    if ((ExtensionMethods.IsKeyDownRightNowComputerCheck(EntryPoint.SceneManagementModifierKey) || (EntryPoint.SceneManagementModifierKey == Keys.None)) && ExtensionMethods.IsKeyDownComputerCheck(EntryPoint.SceneManagementKey))
                    {
                        ManagementMenu.Visible = !ManagementMenu.Visible;
                    }

                    if (_menuPool.AreAnyVisible)
                    {
                        NativeFunction.Natives.SET_PED_STEALTH_MOVEMENT(Game.LocalPlayer.Character, 0, 0);
                    }
                    else if ((ExtensionMethods.IsKeyDownRightNowComputerCheck(GrabPedModifierKey) || GrabPedModifierKey == Keys.None) && ExtensionMethods.IsKeyDownComputerCheck(GrabPedKey))
                    {
                        if (!IsGrabEnabled)
                        {
                            GrabPed();
                        }
                        else
                        {
                            IsGrabEnabled = false;
                        }
                    }

                    if (Game.LocalPlayer.Character.SubmersionLevel < 0.2 && (ExtensionMethods.IsKeyDownComputerCheck(TackleKey) || Game.IsControllerButtonDown(TackleButton)) && Game.LocalPlayer.Character.Speed >= 5.3f)
                    {
                        var nearestPed = GetNearestValidPed(2f, true, false, false, -1);
                        if (nearestPed && !Functions.IsPedArrested(nearestPed) && !Functions.IsPedGettingArrested(nearestPed))
                        {
                            Game.LocalPlayer.Character.IsRagdoll = true;
                            nearestPed.IsRagdoll = true;
                            GameFiber.Sleep(500);
                            Game.LocalPlayer.Character.IsRagdoll = false;
                            GameFiber.Wait(2000);
                            nearestPed.IsRagdoll = false;
                        }
                    }

                    if (CallCoronerTime)
                    {
                        Coroner.Main();
                        CallCoronerTime = false;
                    }
                }
            });
        }
Exemple #27
0
 public static void handleButtonPress(Button b)
 {
     if (PlayAnimations)
     {
         LSPD_First_Response.Mod.API.Functions.PlayPlayerRadioAction(LSPD_First_Response.Mod.API.Functions.GetPlayerRadioAction(), 2500);
     }
     GameFiber.Wait(750);
     if (PlayRadioButtonSounds)
     {
         ButtonSelectSound.Play();
     }
     API.Functions.OnButtonSelected();
     b.SelectAction();
 }
Exemple #28
0
        public override bool OnCalloutAccepted()
        {
            searcharea = SpawnPoint.Around2D(1f, 2f);
            Blip       = new Blip(searcharea, 40f);
            Blip.EnableRoute(Color.Yellow);
            Blip.Color = Color.Yellow;
            Blip.Alpha = 5f;

            Functions.PlayScannerAudioUsingPosition("UNITS WE_HAVE CRIME_CIVILIAN_NEEDING_ASSISTANCE_02", SpawnPoint);
            Game.DisplayNotification("web_lossantospolicedept", "web_lossantospolicedept", "~w~ExampleCallouts", "~y~WelfareCheck", "~b~Dispatch:~w~ Someone called the police for a welfare check. Search the ~y~yellow area~w~ for the person. Respond with ~y~Code 2");
            GameFiber.Wait(2000);

            return(base.OnCalloutAccepted());
        }
Exemple #29
0
 public static void handleButtonPress(Button b)
 {
     if (PlayAnimations)
     {
         Game.LocalPlayer.Character.Tasks.PlayAnimation("random@arrests", "generic_radio_chatter", 1.5f, AnimationFlags.UpperBodyOnly | AnimationFlags.SecondaryTask);
     }
     GameFiber.Wait(750);
     if (PlayRadioButtonSounds)
     {
         ButtonSelectSound.Play();
     }
     //API.Functions.OnButtonSelected();
     b.SelectAction();
 }
Exemple #30
0
 //The suspects peacefully surrender.
 public void Surrender()
 {
     //The suspects surrender.
     Game.DisplaySubtitle("~r~ Suspect: ~w~ Okay, okay! We give up. We give up.");
     UI.Notify("The suspects are ~y~ surrendering!");
     GameFiber.Wait(2000);
    
     //The suspects drop their weapons.
     NativeFunction.Natives.SET_PED_DROPS_WEAPON(Suspect1);
     Suspect1.Tasks.PutHandsUp(-1, Game.LocalPlayer.Character);
     NativeFunction.Natives.SET_PED_DROPS_WEAPON(Suspect2);
     Suspect2.Tasks.PutHandsUp(-1, Game.LocalPlayer.Character);
     StolenVan.Dismiss();
 }