Esempio n. 1
0
        public void StartMurderScenario()
        {
            GameFiber.StartNew(delegate
            {
                this.pursuit = Functions.CreatePursuit();

                int r = new Random().Next(1, 5);
                int t = new Random().Next(1, 3);

                state = EMurderState.DecisionMade;

                if (r == 1)
                {
                    NativeFunction.CallByName <uint>("TASK_COMBAT_PED", Aggressor, Victim, 0, 1);
                    NativeFunction.CallByName <uint>("TASK_REACT_AND_FLEE_PED", Victim, Aggressor);

                    GameFiber.Sleep(5000);

                    NativeFunction.CallByName <uint>("TASK_REACT_AND_FLEE_PED", Victim, Aggressor);

                    if (t == 1)
                    {
                        NativeFunction.CallByName <uint>("TASK_COMBAT_PED", Aggressor, Game.LocalPlayer.Character, 0, 1);

                        GameFiber.Sleep(4500);
                    }

                    if (t == 2)
                    {
                        Victim.Kill();

                        if (!Victim.IsAlive)
                        {
                            isDead = true;
                        }

                        if (isDead == true)
                        {
                            NativeFunction.CallByName <uint>("TASK_AIM_GUN_AT_ENTITY", Aggressor, Victim, -1, true);
                        }
                    }
                }
                else
                {
                    NativeFunction.CallByName <uint>("TASK_REACT_AND_FLEE_PED", Victim, Aggressor);
                }

                if (Aggressor.Exists())
                {
                    Aggressor.Dismiss();
                }

                Functions.AddPedToPursuit(this.pursuit, Aggressor);

                Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Pursuit, LSPD_First_Response.EBackupUnitType.LocalUnit);
            });
        }
Esempio n. 2
0
        public override void Process()
        {
            base.Process();

            if (state == EMurderState.EnRoute && Game.LocalPlayer.Character.Position.DistanceTo(SpawnPoint) <= 15)
            {
                state = EMurderState.OnScene;

                StartMurderScenario();
            }

            if (state == EMurderState.DecisionMade && !Functions.IsPursuitStillRunning(pursuit))
            {
                this.End();
            }

            if (Game.IsKeyDown(Keys.End))
            {
                this.End();
            }
        }
Esempio n. 3
0
        public override bool OnCalloutAccepted()
        {
            state = EMurderState.EnRoute;

            string myPedsGun = pedsGun[myRand.Next(pedsGun.Length)];

            aggressorBlip = Aggressor.AttachBlip();
            aggressorBlip.EnableRoute(Color.DarkOrange);

            Aggressor.Inventory.GiveNewWeapon(myPedsGun, 50, true);

            if (Victim.IsAlive)
            {
                NativeFunction.CallByName <uint>("TASK_AIM_GUN_AT_ENTITY", Aggressor, Victim, -1, true);
                Victim.Tasks.PutHandsUp(-1, Aggressor);

                Victim.BlockPermanentEvents = true;
            }

            Game.DisplaySubtitle("~b~" + Main.playerName + " ~w~Get to the ~r~scene~w~.", 6500);

            return(base.OnCalloutAccepted());
        }