Esempio n. 1
0
        private void SaveOutfit()
        {
            Ped player = Game.Player.Character;

            ini.SetValue <int>("Save", "model", player.Model.Hash);
            ini.SetValue <int>("Save", "beard", Outfits.GetBeardComponent(player));
            ini.SetValue <int>("Save", "hair", Outfits.GetHairComponent(player));
            ini.SetValue <int>("Save", "upper", Outfits.GetUpperComponent(player));
            ini.SetValue <int>("Save", "lower", Outfits.GetLowerComponent(player));
            ini.SetValue <int>("Save", "hands", Outfits.GetHandsComponent(player));
            ini.SetValue <int>("Save", "shoes", Outfits.GetShoesComponent(player));
            ini.SetValue <int>("Save", "accone", Outfits.GetAccOneComponent(player));
            ini.SetValue <int>("Save", "acctwo", Outfits.GetAccTwoComponent(player));
            ini.SetValue <int>("Save", "shirt", Outfits.GetShirtComponent(player));

            ini.SetValue <int>("Save", "beardcolor", Outfits.GetBeardComponentColor(player));
            ini.SetValue <int>("Save", "haircolor", Outfits.GetHairComponentColor(player));
            ini.SetValue <int>("Save", "uppercolor", Outfits.GetUpperComponentColor(player));
            ini.SetValue <int>("Save", "lowercolor", Outfits.GetLowerComponentColor(player));
            ini.SetValue <int>("Save", "handscolor", Outfits.GetHandsComponentColor(player));
            ini.SetValue <int>("Save", "shoescolor", Outfits.GetShoesComponentColor(player));
            ini.SetValue <int>("Save", "acconecolor", Outfits.GetAccOneComponentColor(player));
            ini.SetValue <int>("Save", "acctwocolor", Outfits.GetAccTwoComponentColor(player));
            ini.SetValue <int>("Save", "shirtcolor", Outfits.GetShirtComponentColor(player));

            ini.SetValue <int>("Save", "hat", Outfits.GetHatProp(player));
            ini.SetValue <int>("Save", "glasses", Outfits.GetGlassesProp(player));
            ini.SetValue <int>("Save", "ears", Outfits.GetEarProp(player));
            ini.SetValue <int>("Save", "watch", Outfits.GetWatchProp(player));

            ini.SetValue <int>("Save", "hatcolor", Outfits.GetHatPropColor(player));
            ini.SetValue <int>("Save", "glassescolor", Outfits.GetGlassesPropColor(player));
            ini.SetValue <int>("Save", "earscolor", Outfits.GetEarPropColor(player));
            ini.SetValue <int>("Save", "watchcolor", Outfits.GetWatchPropColor(player));
        }
Esempio n. 2
0
        public JaysMod()
        {
            World.PauseClock(false);
            sirens = new Dictionary <Vehicle, bool>();
            setupIni();

            //GTA.UI.Screen.ShowHelpTextThisFrame("Starting");
            modMenuPool = new MenuPool();
            mainMenu    = new UIMenu("Jay's Mod", "SELECT AN OPTION");
            modMenuPool.Add(mainMenu);
            UIMenuItem save = new UIMenuItem("Save Game");
            UIMenuItem load = new UIMenuItem("Load Game");
            UIMenuItem quit = new UIMenuItem("Quit Game");

            mainMenu.AddItem(save);
            mainMenu.AddItem(load);
            mainMenu.AddItem(quit);
            mainMenu.OnItemSelect += (sender, item, index) =>
            {
                if (item == save)
                {
                    SaveGame();
                }
                else if (item == load)
                {
                    if (!GameLoaded)
                    {
                        OriginalModel    = Game.Player.Character.Model.Hash;
                        OriginalPosition = Game.Player.Character.Position;
                        OriginalHeading  = Game.Player.Character.Heading;
                        OriginalDateTime = World.CurrentDate;
                    }
                    LoadGame();
                }
                else if (item == quit)
                {
                    QuitGame();
                }
            };
            Modules();
            Debug();
            mainMenu.RefreshIndex();
            Outfits.setOutfits();

            GameLoaded = false;

            Tick    += onTick;
            KeyDown += onKeyDown;
        }
Esempio n. 3
0
 void onTick(object sender, EventArgs e)
 {
     if (GameLoaded)
     {
         if (DateTime.Now.Minute != Minutes)
         {
             World.CurrentDate = World.CurrentDate.AddMinutes(1);
             Minutes           = DateTime.Now.Minute;
         }
         Outfits.OnTick();
     }
     if (modMenuPool != null)
     {
         modMenuPool.ProcessMenus();
     }
     if ((Game.Player.IsDead || Game.Player.Character.Health == 0) &&
         Game.Player.Character.Model.Hash != Function.Call <int>(Hash.GET_HASH_KEY, "player_zero") &&
         Game.Player.Character.Model.Hash != Function.Call <int>(Hash.GET_HASH_KEY, "player_one") &&
         Game.Player.Character.Model.Hash != Function.Call <int>(Hash.GET_HASH_KEY, "player_two"))
     {
         Respawn();
     }
 }
Esempio n. 4
0
 void onKeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F5 && !modMenuPool.IsAnyMenuOpen())
     {
         mainMenu.Visible = !mainMenu.Visible;
     }
     else if (e.KeyCode == Keys.F5)
     {
         modMenuPool.CloseAllMenus();
     }
     else if (e.KeyCode == Keys.J)
     {
         if (Game.Player.Character.IsInVehicle())
         {
             Vehicle vehicle = Game.Player.Character.CurrentVehicle;
             if (vehicle.HasSiren && sirens.ContainsKey(vehicle))
             {
                 bool silent;
                 sirens.TryGetValue(vehicle, out silent);
                 vehicle.IsSirenSilent = !silent;
                 sirens.Remove(vehicle);
                 sirens.Add(vehicle, !silent);
             }
             else if (vehicle.HasSiren)
             {
                 bool silent = true;
                 vehicle.IsSirenSilent = silent;
                 sirens.Add(vehicle, silent);
             }
         }
     }
     else
     {
         Outfits.OnKeyDown(e.KeyCode);
     }
 }
Esempio n. 5
0
        void OutfitsMenu(UIMenu submenu)
        {
            UIMenu outfitMenu = modMenuPool.AddSubMenu(submenu, "Outfits");

            Outfits.OutfitsMenu(outfitMenu);
        }
Esempio n. 6
0
        private void LoadOutfit()
        {
            Ped player = Game.Player.Character;
            int beard  = ini.GetValue <int>("Save", "beard", Outfits.GetBeardComponent(player));
            int hair   = ini.GetValue <int>("Save", "hair", Outfits.GetHairComponent(player));
            int upper  = ini.GetValue <int>("Save", "upper", Outfits.GetUpperComponent(player));
            int lower  = ini.GetValue <int>("Save", "lower", Outfits.GetLowerComponent(player));
            int hands  = ini.GetValue <int>("Save", "hands", Outfits.GetHandsComponent(player));
            int shoes  = ini.GetValue <int>("Save", "shoes", Outfits.GetShoesComponent(player));
            int accone = ini.GetValue <int>("Save", "accone", Outfits.GetAccOneComponent(player));
            int acctwo = ini.GetValue <int>("Save", "acctwo", Outfits.GetAccTwoComponent(player));
            int shirt  = ini.GetValue <int>("Save", "shirt", Outfits.GetShoesComponent(player));

            Outfits.SetBeardComponent(player, beard);
            Outfits.SetHairComponent(player, hair);
            Outfits.SetUpperComponent(player, upper);
            Outfits.SetLowerComponent(player, lower);
            Outfits.SetHandsComponent(player, hands);
            Outfits.SetShoesComponent(player, shoes);
            Outfits.SetAccOneComponent(player, accone);
            Outfits.SetAccTwoComponent(player, acctwo);
            Outfits.SetShirtComponent(player, shirt);

            int beardColor  = ini.GetValue <int>("Save", "beardcolor", Outfits.GetBeardComponentColor(player));
            int hairColor   = ini.GetValue <int>("Save", "haircolor", Outfits.GetHairComponentColor(player));
            int upperColor  = ini.GetValue <int>("Save", "uppercolor", Outfits.GetUpperComponentColor(player));
            int lowerColor  = ini.GetValue <int>("Save", "lowercolor", Outfits.GetLowerComponentColor(player));
            int handsColor  = ini.GetValue <int>("Save", "handscolor", Outfits.GetHandsComponentColor(player));
            int shoesColor  = ini.GetValue <int>("Save", "shoescolor", Outfits.GetShoesComponentColor(player));
            int accOneColor = ini.GetValue <int>("Save", "acconecolor", Outfits.GetAccOneComponentColor(player));
            int accTwoColor = ini.GetValue <int>("Save", "acctwocolor", Outfits.GetAccTwoComponentColor(player));
            int shirtColor  = ini.GetValue <int>("Save", "shirtcolor", Outfits.GetShirtComponentColor(player));

            Outfits.SetBeardComponentColor(player, beardColor);
            Outfits.SetHairComponentColor(player, hairColor);
            Outfits.SetUpperComponentColor(player, upperColor);
            Outfits.SetLowerComponentColor(player, lowerColor);
            Outfits.SetHandsComponentColor(player, handsColor);
            Outfits.SetShoesComponentColor(player, shoesColor);
            Outfits.SetAccOneComponentColor(player, accOneColor);
            Outfits.SetAccTwoComponentColor(player, accTwoColor);
            Outfits.SetShirtComponentColor(player, shirtColor);

            int hat     = ini.GetValue <int>("Save", "hat", Outfits.GetHatProp(player));
            int glasses = ini.GetValue <int>("Save", "glasses", Outfits.GetGlassesProp(player));
            int ears    = ini.GetValue <int>("Save", "ears", Outfits.GetEarProp(player));
            int watch   = ini.GetValue <int>("Save", "watch", Outfits.GetWatchProp(player));

            Outfits.SetHatProp(player, hat);
            Outfits.SetGlassesProp(player, glasses);
            Outfits.SetEarProp(player, ears);
            Outfits.SetWatchProp(player, watch);

            int hatColor     = ini.GetValue <int>("Save", "hatcolor", Outfits.GetHatPropColor(player));
            int glassesColor = ini.GetValue <int>("Save", "glassescolor", Outfits.GetGlassesPropColor(player));
            int earsColor    = ini.GetValue <int>("Save", "earscolor", Outfits.GetEarPropColor(player));
            int watchColor   = ini.GetValue <int>("Save", "watchcolor", Outfits.GetWatchPropColor(player));

            Outfits.SetHatPropColor(player, hatColor);
            Outfits.SetGlassesPropColor(player, glassesColor);
            Outfits.SetEarPropColor(player, earsColor);
            Outfits.SetWatchPropColor(player, watchColor);
        }