Example #1
0
 public void Setup()
 {
     InputArgument[] arguments = new InputArgument[10];
     arguments[0] = -10000f;
     arguments[1] = -10000f;
     arguments[2] = -1000f;
     arguments[3] = 10000f;
     arguments[4] = 10000f;
     arguments[5] = 1000f;
     arguments[6] = 0;
     arguments[7] = 1;
     arguments[8] = 1;
     arguments[9] = 1;
     Function.Call(Hash._0x1B5C85C612E5256E, arguments);
     InputArgument[] argumentArray2 = new InputArgument[] { Game.Player.Character.Position.X, Game.Player.Character.Position.Y, Game.Player.Character.Position.Z, 1000f, false, false, false, false };
     Function.Call(Hash._0xA56F01F3765B93A0, argumentArray2);
     InputArgument[] argumentArray3 = new InputArgument[] { false };
     Function.Call(Hash._0x102E68B2024D536D, argumentArray3);
     InputArgument[] argumentArray4 = new InputArgument[] { false };
     Function.Call(Hash._0x84436EC293B1415F, argumentArray4);
     InputArgument[] argumentArray5 = new InputArgument[] { false };
     Function.Call(Hash._0x80D9F74197EA47D9, argumentArray5);
     InputArgument[] argumentArray6 = new InputArgument[] { false };
     Function.Call(Hash._0x2AFD795EEAC8D30D, argumentArray6);
     Function.Call(Hash._0x736A718577F39C7D, Array.Empty <InputArgument>());
     InputArgument[] argumentArray7 = new InputArgument[] { 0 };
     Function.Call(Hash._0x8C95333CFC3340F3, argumentArray7);
     InputArgument[] argumentArray8 = new InputArgument[] { 0 };
     Function.Call(Hash._0xCB9E1EB3BE2AF4E9, argumentArray8);
     InputArgument[] argumentArray9 = new InputArgument[] { false };
     Function.Call(Hash._0x608207E7A8FB787C, argumentArray9);
     InputArgument[] argumentArray10 = new InputArgument[] { 0 };
     Function.Call(Hash._0xCAA15F13EBD417FF, argumentArray10);
     InputArgument[] argumentArray11 = new InputArgument[] { false };
     Function.Call(Hash._0xF796359A959DF65D, argumentArray11);
     InputArgument[] argumentArray12 = new InputArgument[] { true };
     Function.Call(Hash._0xC9F98AC1884E73A2, argumentArray12);
     Ped[] allPeds = World.GetAllPeds();
     if (allPeds.Length != 0)
     {
         foreach (Ped ped in allPeds)
         {
             ped.Delete();
         }
     }
     Vehicle[] allVehicles = World.GetAllVehicles();
     if (allVehicles.Length != 0)
     {
         foreach (Vehicle vehicle in allVehicles)
         {
             vehicle.Delete();
         }
     }
     World.SetBlackout(true);
     World.TransitionToWeather(RandoMath.GetRandomElementFromArray <Weather>(weathers), 0f);
     InputArgument[] argumentArray13 = new InputArgument[] { 7, 0, 0 };
     Function.Call(Hash._0x47C3B5848C3E45D8, argumentArray13);
     InputArgument[] argumentArray14 = new InputArgument[] { 1, 1, 20 };
     Function.Call(Hash._0xB096419DF0D06CE7, argumentArray14);
 }
Example #2
0
 public static void Sleep(Vector3 position)
 {
     if (World.GetNearbyPeds(position, 50f).Where <Ped>(new Func <Ped, bool>(Population.IsEnemy)).ToArray <Ped>().Any <Ped>())
     {
         UI.Notify("You cannot sleep here as there are ~r~hostiles~w~ nearby!");
     }
     else
     {
         TimeSpan span = World.CurrentDayTime + new TimeSpan(0, 8, 0, 0);
         Game.Player.Character.IsVisible      = false;
         Game.Player.CanControlCharacter      = false;
         Game.Player.Character.FreezePosition = true;
         Game.FadeScreenOut(0x7d0);
         Script.Wait(0x7d0);
         World.CurrentDayTime                 = span;
         Game.Player.Character.IsVisible      = true;
         Game.Player.CanControlCharacter      = true;
         Game.Player.Character.FreezePosition = false;
         Game.Player.Character.ClearBloodDamage();
         World.Weather = RandoMath.GetRandomElementFromArray <Weather>(Map.weathers);
         Character.currentEnergyLevel  = 1f;
         Character.currentHungerLevel -= 0.15f;
         Character.currentThirstLevel -= 0.25f;
         Script.Wait(0x7d0);
         Game.FadeScreenIn(0x7d0);
     }
 }
Example #3
0
        public void VehicleSpawn(Vector3 position, float heading)
        {
            int maxVehicles = Population.maxVehicles;

            if (IsCityZone(Game.Player.Character.Position))
            {
                maxVehicles = Population.maxVehicles * 2;
            }
            if (((this.vehicleCount < maxVehicles) && ((position != Vector3.Zero) && (Extensions.DistanceBetweenV3(position, this.startingLoc) >= minSpawnDistance))) && (Extensions.DistanceBetweenV3(position, Game.Player.Character.Position) >= minSpawnDistance))
            {
                Vehicle vehicle = Extensions.SpawnVehicle(GetRandomVehicleModel(), position, heading);
                vehicle.EngineHealth = (RandoMath.CachedRandom.Next(0, 100) > 10) ? 0f : 1000f;
                vehicle.DirtLevel    = 14f;
                VehicleDoor[] doors = vehicle.GetDoors();
                int           num3  = 0;
                while (true)
                {
                    if (num3 >= 5)
                    {
                        int item = 0;
                        while (true)
                        {
                            if (item >= 3)
                            {
                                break;
                            }
                            List <int>      theList   = new List <int>();
                            InputArgument[] arguments = new InputArgument[] { vehicle.Handle, item };
                            if (Function.Call <bool>(Hash._0x46E571A0E20D01F1, arguments))
                            {
                                theList.Add(item);
                            }
                            if (theList.Count > 0)
                            {
                                int             randomElementFromList = RandoMath.GetRandomElementFromList <int>(theList);
                                InputArgument[] argumentArray2        = new InputArgument[] { vehicle.Handle, randomElementFromList };
                                Function.Call(Hash._0x9E5B5E4D2CCD2259, argumentArray2);
                            }
                            item++;
                        }
                        break;
                    }
                    VehicleDoor randomElementFromArray = RandoMath.GetRandomElementFromArray <VehicleDoor>(doors);
                    vehicle.OpenDoor(randomElementFromArray, false, true);
                    num3++;
                }
            }
        }
Example #4
0
        public void Setup()
        {
            this.playerOldMaxWantedLevel = Game.MaxWantedLevel;
            this.playerOldMoney          = Game.Player.Money;
            this.playerOldPosition       = Game.Player.Character.Position;
            this.playerOldHeading        = Game.Player.Character.Heading;
            this.playerOldModel          = Game.Player.Character.Model;
            this.playerOldWeapons        = Game.Player.Character.Weapons;
            Game.MaxWantedLevel          = 0;
            Game.Player.WantedLevel      = 0;
            Game.Player.Money            = 0;
            PedHash[] hashArray  = new PedHash[] { PedHash.FreemodeMale01 };
            PedHash[] hashArray2 = new PedHash[] { (PedHash)(-1667301416) };
            PedHash[] theArray   = (playerGender != Gender.Male) ? hashArray2 : hashArray;
            Model     model      = new Model(RandoMath.GetRandomElementFromArray <PedHash>(theArray));

            model.Request(500);
            if (model.IsInCdImage && model.IsValid)
            {
                while (true)
                {
                    if (model.IsLoaded)
                    {
                        InputArgument[] arguments = new InputArgument[] { Game.Player, model.Hash };
                        Function.Call(Hash._0x00A1CADD00108836, arguments);
                        if (playerGender != Gender.Male)
                        {
                            InputArgument[] argumentArray15 = new InputArgument[11];
                            argumentArray15[0]  = Game.Player.Character.Handle;
                            argumentArray15[1]  = 0x21;
                            argumentArray15[2]  = 0x21;
                            argumentArray15[3]  = 0;
                            argumentArray15[4]  = 0x21;
                            argumentArray15[5]  = 0x21;
                            argumentArray15[6]  = 0;
                            argumentArray15[7]  = 1f;
                            argumentArray15[8]  = 1f;
                            argumentArray15[9]  = 0f;
                            argumentArray15[10] = true;
                            Function.Call(Hash._0x9414E18B9434C2FE, argumentArray15);
                            InputArgument[] argumentArray16 = new InputArgument[] { Game.Player.Character.Handle, 2, 4, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray16);
                            InputArgument[] argumentArray17 = new InputArgument[] { Game.Player.Character.Handle, 11, 0xf3, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray17);
                            InputArgument[] argumentArray18 = new InputArgument[] { Game.Player.Character.Handle, 3, 7, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray18);
                            InputArgument[] argumentArray19 = new InputArgument[] { Game.Player.Character.Handle, 8, 0, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray19);
                            InputArgument[] argumentArray20 = new InputArgument[] { Game.Player.Character.Handle, 6, 0x18, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray20);
                            InputArgument[] argumentArray21 = new InputArgument[] { Game.Player.Character.Handle, 4, 0x54, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray21);
                            InputArgument[] argumentArray22 = new InputArgument[] { Game.Player.Character.Handle, 11, 11 };
                            Function.Call(Hash._0x4CFFC65454C93A49, argumentArray22);
                            InputArgument[] argumentArray23 = new InputArgument[] { Game.Player.Character.Handle, 3 };
                            Function.Call(Hash._0x50B56988B170AFDF, argumentArray23);
                            InputArgument[] argumentArray24 = new InputArgument[] { Game.Player.Character.Handle, 2, 1, 1f };
                            Function.Call(Hash._0x48F44967FA05CC1E, argumentArray24);
                            InputArgument[] argumentArray25 = new InputArgument[] { Game.Player.Character.Handle, 2, 1, 11, 11 };
                            Function.Call(Hash._0x497BF74A7B9CB952, argumentArray25);
                        }
                        else
                        {
                            InputArgument[] argumentArray2 = new InputArgument[11];
                            argumentArray2[0]  = Game.Player.Character.Handle;
                            argumentArray2[1]  = 0x2c;
                            argumentArray2[2]  = 0x2c;
                            argumentArray2[3]  = 0;
                            argumentArray2[4]  = 0x2c;
                            argumentArray2[5]  = 0x2c;
                            argumentArray2[6]  = 0;
                            argumentArray2[7]  = 1f;
                            argumentArray2[8]  = 1f;
                            argumentArray2[9]  = 0f;
                            argumentArray2[10] = true;
                            Function.Call(Hash._0x9414E18B9434C2FE, argumentArray2);
                            InputArgument[] argumentArray3 = new InputArgument[] { Game.Player.Character.Handle, 3, 12, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray3);
                            InputArgument[] argumentArray4 = new InputArgument[] { Game.Player.Character.Handle, 4, 1, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray4);
                            InputArgument[] argumentArray5 = new InputArgument[] { Game.Player.Character.Handle, 8, 0, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray5);
                            InputArgument[] argumentArray6 = new InputArgument[] { Game.Player.Character.Handle, 11, 0xe9, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray6);
                            InputArgument[] argumentArray7 = new InputArgument[] { Game.Player.Character.Handle, 6, 0x18, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray7);
                            InputArgument[] argumentArray8 = new InputArgument[] { Game.Player.Character.Handle, 2, 12, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray8);
                            InputArgument[] argumentArray9 = new InputArgument[] { Game.Player.Character.Handle, 0x39, 0x3a };
                            Function.Call(Hash._0x4CFFC65454C93A49, argumentArray9);
                            InputArgument[] argumentArray10 = new InputArgument[] { Game.Player.Character.Handle, 3 };
                            Function.Call(Hash._0x50B56988B170AFDF, argumentArray10);
                            InputArgument[] argumentArray11 = new InputArgument[] { Game.Player.Character.Handle, 1, 0, 1f };
                            Function.Call(Hash._0x48F44967FA05CC1E, argumentArray11);
                            InputArgument[] argumentArray12 = new InputArgument[] { Game.Player.Character.Handle, 2, 1, 1f };
                            Function.Call(Hash._0x48F44967FA05CC1E, argumentArray12);
                            InputArgument[] argumentArray13 = new InputArgument[] { Game.Player.Character.Handle, 1, 1, 0x39, 0x3a };
                            Function.Call(Hash._0x497BF74A7B9CB952, argumentArray13);
                            InputArgument[] argumentArray14 = new InputArgument[] { Game.Player.Character.Handle, 2, 1, 0x39, 0x3a };
                            Function.Call(Hash._0x497BF74A7B9CB952, argumentArray14);
                        }
                        break;
                    }
                    Script.Wait(100);
                }
            }
            model.MarkAsNoLongerNeeded();
            Game.Player.Money = 0;
            Game.Player.Character.Position = new Vector3(478.8616f, -921.53f, 38.77953f);
            Game.Player.Character.Heading  = 266f;
            Model model2 = new Model("prop_beach_fire");

            model2.Request(250);
            if (model2.IsInCdImage && model2.IsValid)
            {
                while (true)
                {
                    if (model2.IsLoaded)
                    {
                        Vector3 position = new Vector3(482.3683f, -921.3369f, 37.2f);
                        campFire = World.CreateProp(model2, position, true, false);
                        break;
                    }
                    Script.Wait(50);
                }
            }
            model2.MarkAsNoLongerNeeded();
            campFire.AddBlip();
            campFire.CurrentBlip.Sprite = BlipSprite.HotProperty;
            campFire.CurrentBlip.Color  = BlipColor.Yellow;
            campFire.CurrentBlip.Name   = "Campfire";
            Model model3 = new Model("prop_skid_tent_01");

            model3.Request(250);
            if (model3.IsInCdImage && model3.IsValid)
            {
                while (true)
                {
                    if (model3.IsLoaded)
                    {
                        Vector3 position = new Vector3(478.2682f, -925.3043f, 36.8f);
                        tent         = World.CreateProp(model3, position, true, false);
                        tent.Heading = 135f;
                        break;
                    }
                    Script.Wait(50);
                }
            }
            model3.MarkAsNoLongerNeeded();
            tent.AddBlip();
            tent.CurrentBlip.Sprite = BlipSprite.CaptureHouse;
            tent.CurrentBlip.Color  = BlipColor.Blue;
            tent.CurrentBlip.Name   = "Tent";
            Model model4 = new Model("prop_const_fence02a");

            model4.Request(250);
            if (model4.IsInCdImage && model4.IsValid)
            {
                while (true)
                {
                    if (model4.IsLoaded)
                    {
                        Vector3 position = new Vector3(418.9457f, -890.5727f, 28.4f);
                        barrier         = World.CreateProp(model4, position, true, false);
                        barrier.Heading = 270f;
                        break;
                    }
                    Script.Wait(50);
                }
            }
            model4.MarkAsNoLongerNeeded();
            Model model5 = new Model("prop_dumpster_02a");

            model5.Request(250);
            if (model5.IsInCdImage && model5.IsValid)
            {
                while (true)
                {
                    if (model5.IsLoaded)
                    {
                        Vector3 position = new Vector3(459.4905f, -933.745f, 31.2f);
                        dumpster         = World.CreateProp(model5, position, true, false);
                        dumpster.Heading = 270f;
                        break;
                    }
                    Script.Wait(50);
                }
            }
            model5.MarkAsNoLongerNeeded();
            this.ResetCharacter();
        }