static public void Init()
        {
            Function.Call(Hash.DECOR_REGISTER, "Vehicle.Fuel", 1);
            Function.Call(Hash.DECOR_REGISTER, "Vehicle.FuelUsageMultiplier", 1);
            //Client.GetInstance().ClientCommands.Register("/refuel", HandleRefuel);

            //var RefuelPayCashItem = new MenuItemStandard
            //{
            //    Title = "Refuel to Full: Pay Cash",
            //    OnActivate = (item) => Refuel(100)
            //};

            //var RefuelPayDebitItem = new MenuItemStandard
            //{
            //    Title = "Refuel to Full",
            //    OnActivate = (item) => Refuel(100)
            //};

            MenuItem ToRefuelMenuItem = new MenuItemStandard {
                Title = "Refuel to Full", OnActivate = (item) => Refuel(100)
            };

            InteractionListMenu.RegisterInteractionMenuItem(ToRefuelMenuItem, () => { return(isNearFuelPump); }, 1150);

            PeriodicCheck();
        }
        public static void Init()
        {
            MenuOptions PedMenuOptions = new MenuOptions {
                Origin = new PointF(700, 200)
            };

            PedMenu = new PedMenuModel {
                numVisibleItems = 7
            };
            PedMenu.headerTitle = "Character Customization";
            PedMenu.statusTitle = "";
            PedMenu.menuItems   = new List <MenuItem>()
            {
                new MenuItemStandard {
                    Title = "Populating menu..."
                }
            };                                                                                                  // Currently we need at least one item in a menu; could make it work differently, but eh.
            //MenuManager.TestMenu.menuItems.Insert(0, new MenuItemSubMenu { Title = $"Character Customization", SubMenu = PedMenu });
            //MenuManager.TestMenu.SelectedIndex = 0;

            InteractionListMenu.RegisterInteractionMenuItem(new MenuItemSubMenu
            {
                Title   = $"[DEV] Customize Character",
                SubMenu = PedMenu
            }, () => true, 1000);
            Client.GetInstance().RegisterTickHandler(OnTick);
        }
        public static void Init()
        {
            serviceVehicle = null;

            VehicleHashValues              = VehicleLoadoutPresets.PoliceVehicles.Select(v => (VehicleHash)Game.GenerateHash(v)).ToList();
            VehicleHashNames               = VehicleLoadoutPresets.PoliceVehicles.Select(v => v.ToTitleCase().AddSpacesToCamelCase()).ToList();
            VehicleColorValues             = Enum.GetValues(typeof(VehicleColor)).OfType <VehicleColor>().ToList();
            VehicleColorNames              = Enum.GetNames(typeof(VehicleColor)).Select(c => c.AddSpacesToCamelCase()).ToList();
            VehicleWheelTypeValues         = Enum.GetValues(typeof(VehicleWheelType)).OfType <VehicleWheelType>().ToList();
            VehicleWheelTypeNames          = Enum.GetNames(typeof(VehicleWheelType)).Select(c => c.AddSpacesToCamelCase()).ToList();
            currentlySelectedVehicleOnFoot = 0;

            Menu = new PoliceVehicleMenuModel {
                numVisibleItems = 7
            };
            Menu.headerTitle = "Vehicle Customization";
            Menu.statusTitle = "";
            Menu.Refresh();
            //Menu.menuItems = new List<MenuItem>() { new MenuItemStandard { Title = "Populating menu..." } }; // Currently we need at least one item in a menu; could make it work differently, but eh.
            InteractionListMenu.RegisterInteractionMenuItem(new MenuItemSubMenu {
                Title = $"Spawn/Customize Vehicle", SubMenu = Menu
            }, () => true /*CurrentPlayer.CharacterData.Duty.HasFlag(Enums.Character.Duty.Police)*/, 1000);

            Client.GetInstance().RegisterTickHandler(OnTick);
        }
예제 #4
0
        static public void Init()
        {
            PeriodicDamageCheck();
            PeriodicNearbyRefresh();
            Function.Call(Hash.DECOR_REGISTER, $"Damage.Petrol", 3);
            Function.Call(Hash.DECOR_REGISTER, $"Damage.Projectile", 3);
            Function.Call(Hash.DECOR_REGISTER, $"Damage.Melee.Sharp", 3);
            Function.Call(Hash.DECOR_REGISTER, $"Damage.Melee.Blunt", 3);
            Function.Call(Hash.DECOR_REGISTER, $"Damage.Vehicle", 3);
            Function.Call(Hash.DECOR_REGISTER, $"Damage.KillerCategory", 3);

            var pedList = new PedList();

            // Gate after testing
            var weaponSourceMenuItem = new MenuItemStandard {
                Title = "Check Closest for Weapon Source", OnActivate = (item) => { CheckWeaponSources(new PedList().Select(p => new Ped(p)).Where(p => p != Game.PlayerPed).OrderBy(p => p.Position.DistanceToSquared(Game.PlayerPed.Position)).First()); }
            };

            InteractionListMenu.RegisterInteractionMenuItem(weaponSourceMenuItem, () => pedList.Select(p => new Ped(p)).Where(p => p != Game.PlayerPed).Where(p => p.Position.DistanceToSquared(Game.PlayerPed.Position) < 9f).Count() > 0, 1029);

            var damageSourceMenuItem = new MenuItemStandard {
                Title = "Check Closest for Damage Source Type", OnActivate = (item) => { Enum.GetValues(typeof(CountedDamageType)).OfType <CountedDamageType>().ToList().ForEach(dt => { CheckDamageSourceType(new PedList().Select(p => new Ped(p)).Where(p => p != Game.PlayerPed).OrderBy(p => p.Position.DistanceToSquared(Game.PlayerPed.Position)).First(), dt); }); }
            };

            InteractionListMenu.RegisterInteractionMenuItem(damageSourceMenuItem, () => pedList.Select(p => new Ped(p)).Where(p => p != Game.PlayerPed).Where(p => p.Position.DistanceToSquared(Game.PlayerPed.Position) < 9f).Count() > 0, 1030);

            var damageLocationMenuItem = new MenuItemStandard {
                Title = "Check Closest for Damage Location", OnActivate = (item) => { CheckDamageLocation(new PedList().Select(p => new Ped(p)).Where(p => p != Game.PlayerPed).OrderBy(p => p.Position.DistanceToSquared(Game.PlayerPed.Position)).First()); }
            };

            InteractionListMenu.RegisterInteractionMenuItem(damageLocationMenuItem, () => pedList.Select(p => new Ped(p)).Where(p => p != Game.PlayerPed).Where(p => p.Position.DistanceToSquared(Game.PlayerPed.Position) < 9f).Count() > 0, 1031);
        }
예제 #5
0
 static public void Init()
 {
     if (isCop)
     {
         Client.GetInstance().ClientCommands.Register("/radar", Toggle);
         InteractionListMenu.RegisterInteractionMenuItem(menuItemRadar, () => Game.PlayerPed.IsInVehicle() /*CurrentPlayer.CharacterData.Duty.HasFlag(Enums.Character.Duty.Police)*/, 1012);
         InteractionListMenu.RegisterInteractionMenuItem(menuItemLock, () => enabled && Game.PlayerPed.IsInVehicle() /*CurrentPlayer.CharacterData.Duty.HasFlag(Enums.Character.Duty.Police)*/, 1011);
     }
 }
 public static void Init()
 {
     DoorMenu = new MenuModel {
         options = new MenuOptions {
             HeaderBackgroundColor = Color.FromArgb(140, 200, 200)
         }, headerTitle = "Vehicle Door Menu"
     };
     InteractionListMenu.RegisterInteractionMenuItem(new MenuItemSubMenu {
         SubMenu = DoorMenu, Title = "Vehicle Door Menu"
     }, () => Game.PlayerPed.IsInVehicle(), 500);
     Client.GetInstance().RegisterTickHandler(OnTick);
 }
        public static void Init()
        {
            Client.GetInstance().RegisterTickHandler(OnTick);
            Client.GetInstance().ClientCommands.Register("/gsr", TriggerChecks);
            Client.GetInstance().RegisterEventHandler("Player.GSRTest", new Action <int>(Check));
            Client.GetInstance().RegisterEventHandler("Player.GsrResult", new Action <string, bool>(ReceiveResult));
            MenuItem gsrTestMenuItem = new MenuItemStandard {
                Title = "GSR Test Nearby", OnActivate = (item) => TriggerChecks(new Command(""))
            };

            InteractionListMenu.RegisterInteractionMenuItem(gsrTestMenuItem, () => true, 980);
        }
        static public void Init()
        {
            Client.ActiveInstance.RegisterEventHandler("Duty.UpdateDuty", new Action <int, int, bool>(HandleUpdateDuty));
            Client.ActiveInstance.RegisterEventHandler("Duty.InitialDuty", new Action <string>(HandleInitialDuty));
            Client.ActiveInstance.RegisterEventHandler("playerSpawned", new Action(HandlePlayerSpawned));
            Client.ActiveInstance.RegisterEventHandler("Duty.UpdateVehicleBlip", new Action <int>(HandleUpdateBlip));

            var menuItem = new MenuItemStandard {
                Title = "Toggle Duty", OnActivate = (item) => { AttemptDutyToggle(); }
            };

            InteractionListMenu.RegisterInteractionMenuItem(menuItem, () => isAtValidDutyLocation, 1050);
            Client.ActiveInstance.RegisterTickHandler(OnTick);
            RegularBlipCleanup();
        }
 public static void Init()
 {
     Menu = new PoliceCharacterMenuModel {
         numVisibleItems = 7
     };
     Menu.headerTitle = "Character Customization";
     Menu.statusTitle = "";
     Menu.menuItems   = new List <MenuItem>()
     {
         new MenuItemStandard {
             Title = "Populating menu..."
         }
     };                                                                                               // Currently we need at least one item in a menu; could make it work differently, but eh
     InteractionListMenu.RegisterInteractionMenuItem(new MenuItemSubMenu {
         Title = $"Spawn/Customize Character", SubMenu = Menu
     }, () => /*CurrentPlayer.CharacterData.Duty.HasFlag(Enums.Character.Duty.Police) &&*/ Game.PlayerPed.Position.DistanceToSquared(EmergencyServices.policeLoadout) < PoliceMarkerAoe, 1000);
     Client.GetInstance().RegisterTickHandler(OnTick);
 }
예제 #10
0
 public static void Init()
 {
     VehicleMenu = new VehicleMenuModel {
         numVisibleItems = 7                                 /*, options = new MenuOptions { StatusBarBottomMargin = 6, ItemBottomMargin = 6 }*/
     };                                                      // Comment out that if we want some spacing between items
     VehicleMenu.headerTitle = "Vehicle Customization";
     VehicleMenu.statusTitle = "";
     VehicleMenu.menuItems   = new List <MenuItem>()
     {
         new MenuItemStandard {
             Title = "Populating menu..."
         }
     };                                                                                                      // Currently we need at least one item in a menu; could make it work differently, but eh.
     //MenuManager.TestMenu.menuItems.Insert(0, new MenuItemSubMenu { Title = $"Vehicle Customization", SubMenu = VehicleMenu });
     InteractionListMenu.RegisterInteractionMenuItem(new MenuItemSubMenu
     {
         Title   = $"[DEV] Spawn/Customize Vehicle",
         SubMenu = VehicleMenu
     }, () => true, 1000);
     Client.GetInstance().RegisterTickHandler(OnTick);
 }
예제 #11
0
        internal static void InitMenu()
        {
            Log.Verbose($"GarageMenu InitMenu");
            try
            {
                var item = new MenuItemStandard()
                {
                    Title      = "Park Vehicle",
                    OnActivate = ParkCarFromMenu
                };
                InteractionListMenu.RegisterInteractionMenuItem(item, CheckPedGarageProximity, 500);

                // Vehicle Selection, requires sub menu
                var items = new List <MenuItemStandard>()
                {
                    new MenuItemStandard()
                    {
                        Title      = "SomeCar",
                        OnActivate = TestEvent
                    }
                };
                VehicleSelectMenu = new MenuItemSubMenu()
                {
                    Title   = "Vehicle Select",
                    SubMenu = new MenuModel()
                    {
                        headerTitle = "Some sub menu"
                    }
                };
                VehicleSelectMenu.SubMenu.MenuItems.AddRange(items);
                InteractionListMenu.RegisterInteractionMenuItem(VehicleSelectMenu, CheckPedGarageProximity, 500);
            }
            catch (Exception ex)
            {
                Log.Error($"GarageMenu InitMenu Error: {ex.Message}");
            }
        }
예제 #12
0
 static public void Init()
 {
     PeriodicRefresh();
     QuickerPeriodicRefresh();
     InteractionListMenu.RegisterInteractionMenuItem(menuItem, () => NearbyCellDoor != null, 1010);
 }
예제 #13
0
 static public void Init()
 {
     Client.GetInstance().RegisterTickHandler(OnTick);
     InteractionListMenu.RegisterInteractionMenuItem(menuItem, () => !Game.PlayerPed.IsInVehicle() /*CurrentPlayer.CharacterData.Duty.HasFlag(Enums.Character.Duty.Police)*/, 1010);
 }
예제 #14
0
 static public void Init()
 {
     InteractionListMenu.RegisterInteractionMenuItem(menuItemFix, () => Game.PlayerPed.IsInVehicle() /* && isCop */, 999);
     PeriodicUpdate();
 }
예제 #15
0
 static public void Init()
 {
     PeriodicCheck();
     Client.GetInstance().ClientCommands.Register("/engine", HandleEngineToggle);
     InteractionListMenu.RegisterInteractionMenuItem(menuItem, () => Game.PlayerPed.IsInVehicle() && Game.PlayerPed.CurrentVehicle.Driver == Game.PlayerPed, 500);
 }
        static public void Init()
        {
            Client.GetInstance().ClientCommands.Register("/emote", HandleEmote);
            Client.GetInstance().RegisterTickHandler(OnTick);

            var CancelMenuItem = new MenuItemStandard
            {
                Title      = "Cancel Emote",
                OnActivate = (item) =>
                {
                    //if (!(Arrest.playerCuffState == CuffState.None)) return;
                    Game.PlayerPed.Task.ClearAll();
                    isPlayingEmote = false;
                    InteractionListMenu.Observer.CloseMenu();
                }
            };

            var CancelImmediatelyMenuItem = new MenuItemStandard
            {
                Title      = "Cancel Emote (Immediately)",
                OnActivate = (item) =>
                {
                    //if (!(Arrest.playerCuffState == CuffState.None)) return;
                    Game.PlayerPed.Task.ClearAllImmediately();
                    isPlayingEmote = false;
                    InteractionListMenu.Observer.CloseMenu();
                }
            };

            InteractionListMenu.RegisterInteractionMenuItem(CancelMenuItem, () => { return(isPlayingEmote); }, 1150);
            InteractionListMenu.RegisterInteractionMenuItem(CancelImmediatelyMenuItem, () => { return(isPlayingEmote); }, 1149);

            var CancelEmoteMenu = new MenuModel {
                headerTitle = "Emotes", menuItems = new List <MenuItem>()
                {
                    CancelMenuItem, CancelImmediatelyMenuItem
                }
            };

            List <MenuItem> EmotesMenuItems = new List <MenuItem>();

            scenarios.OrderBy(x => x.Key).ToList().ForEach(s =>
            {
                EmotesMenuItems.Add(new MenuItemStandard
                {
                    Title      = $"{s.Key.ToTitleCase()}",
                    OnActivate = (item) =>
                    {
                        PlayEmote(item.Title.ToLower());
                        InteractionListMenu.Observer.OpenMenu(CancelEmoteMenu);
                    }
                });
            });
            var EmotesMenu = new MenuModel {
                headerTitle = "Emotes", menuItems = EmotesMenuItems
            };
            var ToEmotesMenuItem = new MenuItemSubMenu {
                Title = "Emotes", SubMenu = EmotesMenu
            };

            InteractionListMenu.RegisterInteractionMenuItem(ToEmotesMenuItem, () => { return(!isPlayingEmote && !Game.PlayerPed.IsInVehicle()); }, 1150);
        }
예제 #17
0
 public static void Init()
 {
     InteractionListMenu.RegisterInteractionMenuItem(menuItem, () => true);
 }