Example #1
0
        public override bool OnCalloutAccepted()
        {
            if (computerPlusRunning)
            {
                ComputerPlusWrapperClass.SetCalloutStatusToUnitResponding(callID);
                Game.DisplayHelp("Check Computer+ for further call details");
                ComputerPlusWrapperClass.UpdateCalloutDescription(callID, "Caller states a van with 1 occupant pulled up to their neighbours house while they're on vacation and started looking around in the backyard.");
            }

            calloutState = ECalloutState.EnRoute;

            if (calloutState.Equals(ECalloutState.EnRoute))
            {
                NativeFunction.Natives.ClearAreaOfPeds(SpawnPoint, 500f, 0);
            }

            suspect = new Ped("s_m_m_autoshop_02", SusSpawnPoint, 202f)
            {
                IsPersistent         = true,
                BlockPermanentEvents = true
            };

            mechanic = new Ped("a_m_y_stwhi_02", MechSpawnPoint, 20f)
            {
                IsPersistent         = true,
                BlockPermanentEvents = true
            };

            susVehicle = new Vehicle("", VehSpawnPoint);
            susVehicle.IsPersistent = true;

            //If one or both of the peds can't spawn for some reason end the callout
            if (!suspect.Exists())
            {
                End();
            }
            if (!mechanic.Exists())
            {
                End();
            }

            coBlip                = suspect.AttachBlip();
            coBlip.Color          = Color.Yellow;
            coBlip.Scale          = 0.75f;
            coBlip.IsRouteEnabled = true;

            return(base.OnCalloutAccepted());
        }
Example #2
0
        public override bool OnCalloutAccepted()
        {
            if (computerPlusRunning)
            {
                ComputerPlusWrapperClass.SetCalloutStatusToUnitResponding(callID);
                Game.DisplayHelp("Check Computer+ for further call details");
                ComputerPlusWrapperClass.UpdateCalloutDescription(callID, "Caller states a van with 1 occupant pulled up to their neighbours house while they're on vacation and started looking around in the backyard.");
            }

            calloutState = ECalloutState.EnRoute;

            if (calloutState.Equals(ECalloutState.EnRoute))
            {
                NativeFunction.Natives.ClearAreaOfPeds(SpawnPoint, 500F, 0);
            }

            //Spawn suspect at SpawnPoint.
            suspect = new Ped("g_m_m_chicold_01", SpawnPoint, 0F)
            {
                //Set suspect as persistent, so it doesn't randomly disappear.
                IsPersistent = true,

                //Block permanent events from suspect.
                BlockPermanentEvents = true
            };

            susVehicle = new Vehicle("YOUGA", VehSpawnPoint);
            NativeFunction.Natives.SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(susVehicle, 0, 0, 0);
            NativeFunction.Natives.SET_VEHICLE_CUSTOM_SECONDARY_COLOUR(susVehicle, 0, 0, 0);
            susVehicle.IsPersistent = true;

            //Stops the callout from being displayed if the suspect can't spawn for some reason
            if (!suspect.Exists())
            {
                End();
            }

            //Attach coBlip to suspect to show where they are.
            coBlip                = suspect.AttachBlip();
            coBlip.Color          = Color.Yellow;
            coBlip.Scale          = 0.75f;
            coBlip.IsRouteEnabled = true;

            Functions.PlayScannerAudioUsingPosition("UNITS_RESPOND_CODE_02_02", this.SpawnPoint);

            return(base.OnCalloutAccepted());
        }
Example #3
0
        public override void Process()
        {
            NativeFunction.Natives.ClearAreaOfPeds(SpawnPoint, 500f, 0);
            if (calloutState == ECalloutState.EnRoute && Game.LocalPlayer.Character.Position.DistanceTo2D(SpawnPoint) <= 25f)
            {
                if (computerPlusRunning)
                {
                    ComputerPlusWrapperClass.SetCalloutStatusToAtScene(callID);
                    ComputerPlusWrapperClass.AddUpdateToCallout(callID, "Officer arrived at scene.");
                    ComputerPlusWrapperClass.AddPedToCallout(callID, suspect);
                    ComputerPlusWrapperClass.AddPedToCallout(callID, mechanic);
                    coBlip.IsRouteEnabled = false;
                }
                coBlip.IsRouteEnabled = false;
                calloutState          = ECalloutState.OnScene;
            }

            if ((suspect.IsDead) || (suspect.IsCuffed))
            {
                End();
            }

            base.Process();
        }
Example #4
0
        private void StartSuspectScenarios()
        {
            GameFiber.StartNew(delegate {
                int r        = new Random().Next(1, 4);
                calloutState = ECalloutState.DecisionMade;
                Game.HideHelp();

                //Suspect & Mechanic fight
                if (r == 1)
                {
                    if ((suspect.IsAlive) && (mechanic.IsAlive))
                    {
                        if (player.DistanceTo2D(suspect.Position) > 20f)
                        {
                            suspect.IsInvincible  = true;
                            mechanic.IsInvincible = true;
                            suspect.Tasks.FightAgainst(mechanic);
                        }
                        else if ((player.IsAiming) && player.DistanceTo2D(suspect.Position) <= 20f)
                        {
                            suspect.MaxHealth  = 200;
                            mechanic.MaxHealth = 200;
                        }
                    }
                    else
                    {
                        End();
                    }
                }

                //Suspect gets in his vehicle and takes off
                if (r == 2)
                {
                    if ((suspect.IsAlive) && (mechanic.IsAlive))
                    {
                        suspect.Tasks.EnterVehicle(susVehicle, 15000, -1).WaitForCompletion(10000);
                        if (!pursuitCreated && Game.LocalPlayer.Character.DistanceTo2D(suspect.Position) < 35F)
                        {
                            pursuit = Functions.CreatePursuit();
                            Functions.AddPedToPursuit(pursuit, suspect);
                            Functions.SetPursuitIsActiveForPlayer(pursuit, true);
                            pursuitCreated = true;
                        }
                        else if (pursuitCreated && !Functions.IsPursuitStillRunning(pursuit))
                        {
                            End();
                        }
                    }
                    else
                    {
                        End();
                    }
                }

                //Mechanic starts damaging suspectes vehicle
                if (r == 3)
                {
                    if ((suspect.IsAlive) && (mechanic.IsAlive))
                    {
                        mechanic.Inventory.GiveNewWeapon("WEAPON_UNARMED", -1, true);
                        mechanic.Tasks.FireWeaponAt(susVehicle, 5000, FiringPattern.FullAutomatic);
                    }
                    else
                    {
                        End();
                    }
                }
            });
        }
Example #5
0
        private void StartSuspectScenarios()
        {
            GameFiber.StartNew(delegate {
                int r        = new Random().Next(1, 4);
                calloutState = ECalloutState.DecisionMade;
                Game.HideHelp();

                //Suspect flees on foot
                if (r == 1)
                {
                    if (suspect.IsAlive)
                    {
                        if (!pursuitCreated && Game.LocalPlayer.Character.DistanceTo2D(suspect.Position) < 35F)
                        {
                            pursuit = Functions.CreatePursuit();
                            Functions.AddPedToPursuit(pursuit, suspect);
                            Functions.SetPursuitIsActiveForPlayer(pursuit, true);
                            pursuitCreated = true;
                        }
                        else if (pursuitCreated && !Functions.IsPursuitStillRunning(pursuit))
                        {
                            End();
                        }
                    }
                    else
                    {
                        End();
                    }
                }

                //Suspect flees in YOUGA
                if (r == 2)
                {
                    if (suspect.IsAlive)
                    {
                        susRunTo = new Vector3(464, 2592, 43);
                        suspect.Tasks.FollowNavigationMeshToPosition(susRunTo, 243, 2).WaitForCompletion(4500);
                        suspect.Tasks.EnterVehicle(susVehicle, 15000, -1).WaitForCompletion(2500);
                        if (!pursuitCreated && Game.LocalPlayer.Character.DistanceTo2D(suspect.Position) < 35F)
                        {
                            pursuit = Functions.CreatePursuit();
                            Functions.AddPedToPursuit(pursuit, suspect);
                            Functions.SetPursuitIsActiveForPlayer(pursuit, true);
                            pursuitCreated = true;
                        }
                        else if (pursuitCreated && !Functions.IsPursuitStillRunning(pursuit))
                        {
                            End();
                        }
                    }
                    else
                    {
                        End();
                    }
                }

                //Suspect runs at officer with knife
                if (r == 3)
                {
                    suspect.Inventory.GiveNewWeapon("WEAPON_KNIFE", -1, true);
                    if (suspect.IsAlive)
                    {
                        suspect.Tasks.FightAgainst(player);
                    }
                    else
                    {
                        End();
                    }
                }
            });
        }