Esempio n. 1
0
        public override bool OnCalloutAccepted()
        {
            PoliceCar = new Vehicle(CopCarModel, SpawnPoint, SpawnHeading);
            PoliceCar.RandomiseLicencePlate();
            PoliceCar.MakePersistent();
            PoliceCar.IsSirenOn     = true;
            PoliceCar.IsSirenSilent = true;
            PoliceOfficer           = PoliceCar.CreateRandomDriver();
            PoliceOfficer.MakeMissionPed();
            PoliceOfficerBlip                = PoliceOfficer.AttachBlip();
            PoliceOfficerBlip.Color          = Color.Green;
            PoliceOfficerBlip.IsRouteEnabled = true;
            PoliceOfficer.RelationshipGroup  = "PLAYER";
            SuspectCar = new Vehicle(GroundVehiclesToSelectFrom[AssortedCalloutsHandler.rnd.Next(GroundVehiclesToSelectFrom.Length)], PoliceCar.GetOffsetPosition(Vector3.RelativeFront * 9f), PoliceCar.Heading);
            SuspectCar.RandomiseLicencePlate();
            SuspectCar.MakePersistent();
            Suspect = SuspectCar.CreateRandomDriver();
            Suspect.MakeMissionPed();

            Suspect.WarpIntoVehicle(PoliceCar, PoliceCar.PassengerCapacity - 1);
            Functions.SetPedAsArrested(Suspect, true);
            Suspect.RelationshipGroup = "TBACKUPCRIMINAL";
            MainLogic();
            return(base.OnCalloutAccepted());
        }
        public override bool OnCalloutAccepted()
        {
            SuspectCar = new Vehicle("STOCKADE", SpawnPoint);
            SuspectCar.MakePersistent();
            new Ped(Vector3.Zero);
            Suspect.MakeMissionPed();
            SuspectBlip       = Suspect.AttachBlip();
            SuspectBlip.Color = Color.Red;

            Suspect.Inventory.GiveNewWeapon(new WeaponAsset(firearmsToSelectFrom[AssortedCalloutsHandler.rnd.Next(firearmsToSelectFrom.Length)]), -1, true);
            Suspect.WarpIntoVehicle(SuspectCar, -1);
            if (!CalloutRunning)
            {
                CalloutHandler();
            }
            return(base.OnCalloutAccepted());
        }
Esempio n. 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());
        }