Beispiel #1
0
 public void Questioning()
 {
     pCar = LPlayer.LocalPlayer.Ped.IsInVehicle() ? LPlayer.LocalPlayer.Ped.CurrentVehicle : LPlayer.LocalPlayer.LastVehicle;
     //sCar = m.pulloverCar;//LVehicle.FromGTAVehicle(World.GetClosestVehicle(LPlayer.LocalPlayer.LastVehicle.GetOffsetPosition(new Vector3(0, pCar.Model.GetDimensions().Y / 2 + 4, 0)), 5f));
     //sCar.AttachBlip();
     suspect = LPlayer.LocalPlayer.LastVehicle.GetPedOnSeat(LPlayer.LocalPlayer.LastVehicle.IsSeatFree(VehicleSeat.LeftRear) ? VehicleSeat.RightRear : VehicleSeat.LeftRear);
     if (suspect.Exists())                  // If the suspect does exist we can go ahead and question them
     {
         if (sCar != null && sCar.Exists()) // Check for the suspect's vehicle, if it doesn't exist then this isn't a traffic stop.
         {
             IsTrafficStop = true;
             Functions.PrintHelp("~KEY_DIALOG_1~ Conduct Breathtest~n~~KEY_DIALOG_2~ Seize Car~n~~KEY_DIALOG_3~ Release Ped~n~~KEY_DIALOG_4~ Cancel");
             qTimer = new GTA.Timer(10);
             qTimer.Start();
             qTimer.Tick += qTimer_Tick;
         }
         else
         {
             IsTrafficStop = false;
             Functions.PrintHelp("You can only question a suspect from a pullover at this time.");
             m.HasQuestioningFired = false;
             //Functions.PrintHelp("~KEY_DIALOG_1~ Option 2~n~~KEY_DIALOG_2~ Option 2~n~~KEY_DIALOG_3~ Release Ped~n~~KEY_DIALOG_4~ Cancel");
         }
     }
     else
     {
         m.HasQuestioningFired = false;
     }
 }
Beispiel #2
0
        private void StartSmoking()
        {
            if (bSmoking)
            {
                return;
            }
            bSmoking = true;

            Player.Character.Weapons.Unarmed.Select();
            Player.Character.Animation.Play(anims, "create_spliff", 8.0F, animflags);
            Wait(1600);

            spliff = World.CreateObject(0xD130ADEF, Player.Character.Position);
            spliff.AttachToPed(Player.Character, Bone.RightHand, new Vector3(0.14F, 0.03F, 0.04F), new Vector3(2.21F, -0.12F, 0.0F));

            Player.Character.Animation.WaitUntilFinished(anims, "create_spliff");
            timer.Start();
        }
Beispiel #3
0
        //Function for requesting an ambulance for a single ped
        public void RequestMedic()
        {
            //Functions.AddTextToTextwall("I need a paramedic ASAP", "Officer " + LPlayer.LocalPlayer.Username);
            //LPlayer.LocalPlayer.Ped.PlayWalkieTalkieAnimation("");
            if (CalloutsPlusMain.QuickSpawnMethod)
            {
                ambulance = new LVehicle(LPlayer.LocalPlayer.Ped.Position.Around(Common.GetRandomValue(30, 60)),
                                         "AMBULANCE");
            }
            else
            {
                var ambulances        = World.GetAllVehicles("AMBULANCE");
                var selectedAmbulance = ambulances.FirstOrDefault();

                if (selectedAmbulance != null && selectedAmbulance.Exists())
                {
                    ambulance = LVehicle.FromGTAVehicle(selectedAmbulance);
                    //Functions.PrintText("Found an ambulance in the game already, using", 4000);
                    para1 = ambulance.GetPedOnSeat(VehicleSeat.Driver);
                    if (para1.Exists())
                    {
                        para1.Task.ClearAllImmediately();
                        Functions.SetPedIsOwnedByScript(para1, this, true);
                        para1.IsRequiredForMission     = true;
                        ambulance.IsRequiredForMission = true;
                        para1.Task.WarpIntoVehicle(ambulance, VehicleSeat.Driver);
                        DelayedCaller.Call(delegate
                        {
                            para1.Task.DriveTo(LPlayer.LocalPlayer.Ped.Position, 20f, false, false);
                            para1.Task.AlwaysKeepTask    = true;
                            para1.BlockPermanentEvents   = true;
                            ambulance.SirenActive        = true;
                            ambulance.AttachBlip().Color = BlipColor.Green;

                            Functions.AddTextToTextwall("A paramedic has been dispatched to your location, stand-by",
                                                        "CONTROL");
                            //Functions.PlaySoundUsingPosition("INS_I_NEED_A_MEDICAL_TEAM_FOR_ERRR", LPlayer.LocalPlayer.Ped.Position);
                            GTA.Native.Function.Call("ADD_STUCK_CAR_CHECK",
                                                     new GTA.Native.Parameter[] { (Vehicle)ambulance, 2f, 12000 });
                            paramedicCanCancel = true;
                            EMSStatus          = State.Responding;

                            medic = new AnimationSet("medic");

                            paramedicTimer = new GTA.Timer(1000);
                            paramedicTimer.Start();
                            paramedicTimer.Tick += (paramedic_Tick);
                        }, this, 2000);
                    }
                    else
                    {
                        para1 = ambulance.CreatePedOnSeat(VehicleSeat.Driver, "M_Y_PMEDIC");
                        para1.Task.ClearAllImmediately();
                        Functions.SetPedIsOwnedByScript(para1, this, true);
                        para1.Task.WarpIntoVehicle(ambulance, VehicleSeat.Driver);
                        DelayedCaller.Call(delegate
                        {
                            para1.Task.DriveTo(LPlayer.LocalPlayer.Ped.Position, 20f, false, false);
                            para1.Task.AlwaysKeepTask    = true;
                            para1.BlockPermanentEvents   = true;
                            ambulance.SirenActive        = true;
                            ambulance.AttachBlip().Color = BlipColor.Green;

                            Functions.AddTextToTextwall("A paramedic has been dispatched to your location, stand-by",
                                                        "CONTROL");
                            //Functions.PlaySoundUsingPosition("INS_I_NEED_A_MEDICAL_TEAM_FOR_ERRR", LPlayer.LocalPlayer.Ped.Position);
                            GTA.Native.Function.Call("ADD_STUCK_CAR_CHECK",
                                                     new GTA.Native.Parameter[] { (Vehicle)ambulance, 2f, 12000 });
                            paramedicCanCancel = true;
                            EMSStatus          = State.Responding;

                            medic = new AnimationSet("medic");

                            paramedicTimer = new GTA.Timer(1000);
                            paramedicTimer.Start();
                            paramedicTimer.Tick += (paramedic_Tick);
                        }, this, 2000);
                    }
                    if (ambulance.GetPedOnSeat(VehicleSeat.RightFront).Exists())
                    {
                        ambulance.GetPedOnSeat(VehicleSeat.RightFront).Delete();
                    }
                }
                else
                {
                    ambulance =
                        new LVehicle(
                            World.GetNextPositionOnStreet(
                                LPlayer.LocalPlayer.Ped.Position.Around(Common.GetRandomValue(100, 150))), "AMBULANCE");
                    if (ambulance.Exists())
                    {
                        ambulance.PlaceOnNextStreetProperly();
                        if (World.GetClosestVehicle(ambulance.Position, 5f).Exists() &&
                            World.GetClosestVehicle(ambulance.Position, 5f) != ambulance)
                        {
                            ambulance.Heading = World.GetClosestVehicle(ambulance.Position, 5f).Heading;
                        }
                        if (!para1.Exists())
                        {
                            para1 = new LPed(ambulance.Position.Around(5f), "M_Y_PMEDIC");

                            para1.Task.ClearAllImmediately();
                            Functions.SetPedIsOwnedByScript(para1, this, true);
                            para1.Task.WarpIntoVehicle(ambulance, VehicleSeat.Driver);
                            DelayedCaller.Call(delegate
                            {
                                para1.Task.DriveTo(LPlayer.LocalPlayer.Ped.Position, 20f, false, false);
                                para1.Task.AlwaysKeepTask    = true;
                                para1.BlockPermanentEvents   = true;
                                ambulance.SirenActive        = true;
                                ambulance.AttachBlip().Color = BlipColor.Green;

                                Functions.AddTextToTextwall(
                                    "A paramedic has been dispatched to your location, stand-by",
                                    "CONTROL");
                                //Functions.PlaySoundUsingPosition("INS_I_NEED_A_MEDICAL_TEAM_FOR_ERRR", LPlayer.LocalPlayer.Ped.Position);
                                GTA.Native.Function.Call("ADD_STUCK_CAR_CHECK",
                                                         new GTA.Native.Parameter[] { (Vehicle)ambulance, 2f, 12000 });
                                paramedicCanCancel = true;
                                EMSStatus          = State.Responding;

                                medic = new AnimationSet("medic");

                                paramedicTimer = new GTA.Timer(1000);
                                paramedicTimer.Start();
                                paramedicTimer.Tick += (paramedic_Tick);
                            }, this, 2000);
                        }
                    }
                }
            }
        }
Beispiel #4
0
        //Function for requesting a tow truck
        public void RequestTowTruck()
        {
            Functions.AddTextToTextwall("Can I get a removal truck at my location please",
                                        "OFFICER " + LPlayer.LocalPlayer.Username);
            towedCar = World.GetClosestVehicle(LPlayer.LocalPlayer.Ped.Position, 3f);
            if (towedCar != null && towedCar.Exists())
            {
                if (CalloutsPlusMain.QuickSpawnMethod == true)
                // if quick spawn method is set to true, the vehicle will spawn much closer
                {
                    truck = new LVehicle(LPlayer.LocalPlayer.Ped.Position.Around(Common.GetRandomValue(30, 60)),
                                         "PACKER");
                }
                else
                {
                    truck = new LVehicle(LPlayer.LocalPlayer.Ped.Position.Around(Common.GetRandomValue(100, 150)),
                                         "PACKER");
                }

                if (truck != null && truck.Exists())
                {
                    truckDriver = new LPed(truck.Position.Around(2f), "m_y_mechanic_02");
                }

                if (towedCar.Model.isBoat)
                {
                    Functions.PrintText("[TOW TRUCK] We can't tow a boat!", 4000);
                    truck.NoLongerNeeded();
                    truckDriver.NoLongerNeeded();
                    towTruckCalledOut = false;
                }
                else if (towedCar.Model.isHelicopter)
                {
                    Functions.PrintText("[TOW TRUCK] We can't tow a helicopter!", 4000);
                    truck.NoLongerNeeded();
                    truckDriver.NoLongerNeeded();
                    towTruckCalledOut = false;
                }
                else if (towedCar.Model.Hash == 2053223216 || towedCar.Model.Hash == 850991848 ||
                         towedCar.Model.Hash == 2307837162 || towedCar.Model.Hash == 3581397346 ||
                         towedCar.Model.Hash == 1938952078 || towedCar.Model.Hash == 1353720154 ||
                         towedCar.Model.Hash == 904750859 || towedCar.Model.Hash == 569305213)
                {
                    Functions.PrintText(
                        "[TOW TRUCK] We can't tow that, it's too big. Send an impound cop instead.", 4000);
                    truck.NoLongerNeeded();
                    truckDriver.NoLongerNeeded();
                    towTruckCalledOut = false;
                }
                else
                {
                    if (truck != null && truck.Exists())
                    {
                        if (truckDriver != null && truckDriver.Exists())
                        {
                            truck.PlaceOnNextStreetProperly();
                            if (World.GetClosestVehicle(truck.Position, 5f).Exists() &&
                                World.GetClosestVehicle(truck.Position, 5f) != truck)
                            {
                                truck.Heading = World.GetClosestVehicle(truck.Position, 5f).Heading;
                            }

                            truck.Extras(1).Enabled = false;
                            truck.Extras(2).Enabled = false;
                            truck.Extras(3).Enabled = false;
                            truck.Extras(4).Enabled = false;

                            truckDriver.WarpIntoVehicle(truck, VehicleSeat.Driver);
                            truck.AttachBlip().Color = BlipColor.Yellow;
                            DelayedCaller.Call(delegate
                            {
                                Functions.AddTextToTextwall("Affirmative, a removal truck has been dispatched",
                                                            "CONTROL");
                                towTruckCanCancel = true;
                                truckDriver.Task.DriveTo(LPlayer.LocalPlayer.Ped.Position, 20f, true, false);

                                GTA.Native.Function.Call("ADD_STUCK_CAR_CHECK",
                                                         new GTA.Native.Parameter[] { (Vehicle)truck, 2f, 12000 });
                                truckDriver.MakeProofTo(false, true, true, true, false);

                                TTStatus            = State.Responding;
                                towTruckTimer       = new GTA.Timer(1000);
                                towTruckTimer.Tick += TowTruck_Tick;
                                towTruckTimer.Start();
                            }, this, 100);
                        }
                        else
                        {
                            Functions.AddTextToTextwall("Negative we have no drivers available right now.",
                                                        "CONTROL");
                            truck.Delete();
                            towTruckCalledOut = false;
                        }
                    }
                    else
                    {
                        Functions.AddTextToTextwall("Negative at this time, we have no available trucks.", "CONTROL");
                        driver.Delete();
                        towTruckCalledOut = false;
                    }
                }
            }
            else
            {
                Functions.PrintText("There is no vehicle here, tow truck will not be sent", 4000);
                towTruckCalledOut = false;
            }
        }
Beispiel #5
0
        //Function for requesting a removal cop team
        public void RequestRemoval()
        {
            Functions.AddTextToTextwall("Control, I need a unit to remove a vehicle for me.",
                                        "Officer " + LPlayer.LocalPlayer.Username);
            LPlayer.LocalPlayer.Ped.PlayWalkieTalkieAnimation("");
            removalCar = World.GetClosestVehicle(LPlayer.LocalPlayer.Ped.Position, 3.0f);
            if (removalCar != null && removalCar.Exists())
            {
                if (CalloutsPlusMain.QuickSpawnMethod)
                {
                    copCar = new LVehicle(LPlayer.LocalPlayer.Ped.Position.Around(Common.GetRandomValue(30, 60)),
                                          "POLICE");
                }
                else
                {
                    var copcars     = World.GetAllVehicles("POLICE");
                    var selectedCop = copcars.FirstOrDefault();
                    if (selectedCop != null && selectedCop.Exists())
                    {
                        dropOffDriver = LPed.FromGTAPed(selectedCop.GetPedOnSeat(VehicleSeat.Driver));
                        if (dropOffDriver.Exists())
                        {
                            if (!Functions.DoesPedHaveAnOwner(dropOffDriver))
                            {
                                Functions.SetPedIsOwnedByScript(dropOffDriver, this, true);
                                driver = LPed.FromGTAPed(selectedCop.GetPedOnSeat(VehicleSeat.RightFront));
                                if (!driver.Exists())
                                {
                                    driver =
                                        LPed.FromGTAPed(selectedCop.CreatePedOnSeat(VehicleSeat.RightFront, "M_Y_COP"));
                                }
                                Functions.SetPedIsOwnedByScript(driver, this, true);
                                copCar = LVehicle.FromGTAVehicle(selectedCop);
                                copCar.AttachBlip().Color = BlipColor.Green;
                                //Functions.PrintHelp("Selected a cop car already in existance~n~Distance: " + copCar.Position.DistanceTo2D(LPlayer.LocalPlayer.Ped.Position));
                            }
                            dropOffDriver.Task.DriveTo(LPlayer.LocalPlayer.Ped.Position, 20f, true, true);
                            removalTimer = new GTA.Timer(1000);
                            removalTimer.Start();
                            removalTimer.Tick += (removal_Tick);
                            RTStatus           = State.Responding;

                            GTA.Native.Function.Call("ADD_STUCK_CAR_CHECK",
                                                     new GTA.Native.Parameter[] { (Vehicle)copCar, 2f, 12000 });
                            Functions.AddTextToTextwall("Affirmative, a unit is on it's way stand by.", "CONTROL");
                            removalCanCancel = true;
                        }
                        else
                        {
                            Functions.AddTextToTextwall("We were unable to locate a unit available, please try again later.", "CONTROL");
                            removalCalledOut = false;
                            removalCanCancel = false;
                        }
                    }
                    else
                    {
                        copCar =
                            new LVehicle(
                                World.GetNextPositionOnStreet(
                                    LPlayer.LocalPlayer.Ped.Position.Around(Common.GetRandomValue(100, 150))), "POLICE");
                        copCar.PlaceOnNextStreetProperly();
                        if (World.GetClosestVehicle(copCar.Position, 5f).Exists() &&
                            World.GetClosestVehicle(copCar.Position, 5f) != copCar)
                        {
                            copCar.Heading = World.GetClosestVehicle(copCar.Position, 5f).Heading;
                        }

                        dropOffDriver = new LPed(copCar.Position.Around(5f), "M_Y_COP");
                        driver        = new LPed(copCar.Position.Around(5f), "M_Y_COP");
                        if (dropOffDriver.Exists() && driver.Exists())
                        {
                            dropOffDriver.WarpIntoVehicle(copCar, VehicleSeat.Driver);
                            driver.WarpIntoVehicle(copCar, VehicleSeat.RightFront);
                            copCar.AttachBlip().Color = BlipColor.Green;

                            dropOffDriver.Task.DriveTo(LPlayer.LocalPlayer.Ped.Position, 20f, true, true);
                            removalTimer = new GTA.Timer(1000);
                            removalTimer.Start();
                            removalTimer.Tick += (removal_Tick);
                            RTStatus           = State.Responding;

                            GTA.Native.Function.Call("ADD_STUCK_CAR_CHECK",
                                                     new GTA.Native.Parameter[] { (Vehicle)copCar, 2f, 12000 });
                            Functions.AddTextToTextwall("Affirmative, a unit is on it's way stand by.", "CONTROL");
                            removalCanCancel = true;
                        }
                        else
                        {
                            Functions.AddTextToTextwall("We lost contact with the unit, sorry", "CONTROL");
                            if (copCar.Exists())
                            {
                                copCar.AttachBlip().Delete();
                                copCar.Delete();
                            }

                            removalCalledOut = false;
                        }
                    }
                }
            }
            else
            {
                Functions.PrintText("There is no vehicle here!", 4000);
                removalCalledOut = false;
            }
        }