Beispiel #1
0
        public static async Task <int> SpawnBalloons(Vector3 coords)
        {
            var models = new string[] { "prop_beach_volball01", "prop_beach_volball02", "prop_beachball_02", "prop_bskball_01" };
            var root   = await SpawnAtCoords("prop_devin_rope_01", coords, Vector3.Zero, false);

            var balls = new List <int>();

            for (int i = 0; i < API.GetRandomIntInRange(3, 6); ++i)
            {
                var model  = models[API.GetRandomIntInRange(0, models.Length)];
                var offset = new Vector3(API.GetRandomFloatInRange(-0.25f, 0.25f), API.GetRandomFloatInRange(-0.25f, 0.25f), API.GetRandomFloatInRange(0f, 0.75f));
                var ball   = await SpawnAtCoords(model, coords + offset, Vector3.Zero, false);

                Ropes.Attach(root, ball, Vector3.Zero, Vector3.Zero);
                AntiGravity.Add(ball, 1.2f);
                balls.Add(ball);
            }

            foreach (var ball in balls)
            {
                int tmp_ball = ball;
                API.SetEntityAsNoLongerNeeded(ref tmp_ball);
            }

            return(root);
        }
Beispiel #2
0
 public static void RopeClosest(IEnumerable <int> entities, bool tow = false)
 {
     if (Common.GetClosestEntity(entities, out int closest))
     {
         Ropes.PlayerAttach(closest, tow ? Ropes.Mode.Tow : Ropes.Mode.Normal);
     }
     else
     {
         Hud.Notification("Nothing in range");
     }
 }
Beispiel #3
0
        private static void SetupMenu()
        {
            _menu = new MainMenu();

            #region Vehicle
            if (Permission.CanDo(Ability.SpawnVehicle))
            {
                _menu.AddMenuListItem("Vehicle", "Spawn from list ↕", _menu.Submenu <VehicleMenu>().OpenMenu);
            }

            if (Permission.CanDo(Ability.SpawnVehicleByName))
            {
                _menu.AddMenuListItemAsync("Vehicle", "Spawn by name", _menu.Submenu <VehicleMenu>().SpawnByName);
            }

            if (Permission.CanDo(Ability.Autopilot))
            {
                _menu.AddMenuListItemAsync("Vehicle", "Autopilot (toggle)", Autopilot.Toggle);
            }

            if (Permission.CanDo(Ability.TeleportToClosestVehicle))
            {
                _menu.AddMenuListItem("Vehicle", "TP into closest", () => VehicleMenu.TeleportToClosestVehicle());
                _menu.AddMenuListItem("Vehicle", "TP into closest as passenger", () => VehicleMenu.TeleportToClosestVehicle(true));
            }
            #endregion

            #region Prop
            if (Permission.CanDo(Ability.SpawnProp))
            {
                _menu.AddMenuListItem("Prop", "Spawn from list ↕", _menu.Submenu <PropMenu>().OpenMenu);
                _menu.AddMenuListItem("Prop", "Spawn from list (search)", async() =>
                {
                    var prop = await Common.GetUserInput("Filter props", "", 30);
                    _menu.Submenu <PropMenu>().Filter(prop);
                });
                _menu.AddMenuListItemAsync("Prop", "Spawn by name", PropMenu.SpawnByName);
                _menu.AddMenuListItemAsync("Prop", "Clear last", Props.ClearLast);
                _menu.AddMenuListItemAsync("Prop", "Clear all", Props.ClearAll);
            }
            #endregion

            #region Rope
            if (Permission.CanDo(Ability.RopeGun))
            {
                _menu.AddMenuListItem("Rope", "Equip rope gun", Ropes.EquipRopeGun);
            }

            if (Permission.CanDo(Ability.Rope))
            {
                _menu.AddMenuListItem("Rope", "Closest ped", () => Ropes.AttachToClosest(Peds.Get(Peds.Filter.LocalPlayer | Peds.Filter.Dead | Peds.Filter.CurrentVehiclePassengers)));
                _menu.AddMenuListItem("Rope", "Closest vehicle", () => Ropes.AttachToClosest(Vehicles.Get()));
                _menu.AddMenuListItem("Rope", "Closest vehicle tow", () => Ropes.AttachToClosest(Vehicles.Get(), true));
                _menu.AddMenuListItem("Rope", "Closest prop", () => Ropes.AttachToClosest(Props.Get()));
            }

            if (Permission.CanDo(Ability.Rope) || Permission.CanDo(Ability.RopeGun))
            {
                _menu.AddMenuListItem("Rope", "Free myself", Ropes.ClearPlayer);
                _menu.AddMenuListItem("Rope", "Clear last", Ropes.ClearLast);
                _menu.AddMenuListItem("Rope", "Clear all", Ropes.ClearAll);
            }
            #endregion

            #region Companion
            if (Permission.CanDo(Ability.SpawnPocceCompanion))
            {
                _menu.AddMenuListItemAsync("Companion", "Spawn pocce", CompanionMenu.PocceCompanion);
            }

            if (Permission.CanDo(Ability.SpawnPetCompanion))
            {
                _menu.AddMenuListItemAsync("Companion", "Spawn pet", CompanionMenu.PetCompanion);
            }

            if (Permission.CanDo(Ability.SpawnCustomCompanion))
            {
                _menu.AddMenuListItem("Companion", "Spawn custom ↕", _menu.Submenu <CompanionMenu>().CustomCompanion);
                _menu.AddMenuListItemAsync("Companion", "Spawn custom by name", CompanionMenu.CustomCompanionByName);
            }

            if (Permission.CanDo(Ability.SpawnPoccePassengers))
            {
                _menu.AddMenuListItemAsync("Companion", "Pocce passengers", CompanionMenu.PoccePassengers);
            }
            #endregion

            #region Event
            if (Permission.CanDo(Ability.PocceParty))
            {
                _menu.AddMenuListItemAsync("Event", "Pocce party", EventMenu.PocceParty);
            }

            if (Permission.CanDo(Ability.MassScenario))
            {
                _menu.AddMenuListItem("Event", "Play mass scenario", _menu.Submenu <MassScenarioMenu>().OpenMenu);
            }

            if (Permission.CanDo(Ability.PocceRiot))
            {
                _menu.AddMenuListItemAsync("Event", "Pocce riot", EventMenu.PocceRiot);
            }

            if (Permission.CanDo(Ability.PocceRiotArmed))
            {
                _menu.AddMenuListItemAsync("Event", "Pocce riot (armed)", EventMenu.PocceRiotArmed);
            }

            if (Permission.CanDo(Ability.PedRiot))
            {
                _menu.AddMenuListItemAsync("Event", "Ped riot", EventMenu.PedRiot);
            }

            if (Permission.CanDo(Ability.PedRiotArmed))
            {
                _menu.AddMenuListItemAsync("Event", "Ped riot (armed)", EventMenu.PedRiotArmed);
            }
            #endregion

            #region Skin
            if (Permission.CanDo(Ability.IdentifySkins))
            {
                _menu.AddMenuListItem("Skin", "Detect nearby skins", _menu.Submenu <SkinMenu>().DetectSkins);
                _menu.AddMenuListItem("Skin", "Detect player skin", _menu.Submenu <SkinMenu>().DetectPlayerSkin);
            }

            if (Permission.CanDo(Ability.ChangeSkin))
            {
                _menu.AddMenuListItem("Skin", "Choose from last detect ↕", _menu.Submenu <SkinMenu>().ShowLastSkins);
                _menu.AddMenuListItem("Skin", "Choose from all ↕", _menu.Submenu <SkinMenu>().ShowAllSkins);
            }
            #endregion

            #region Upgrade
            if (Permission.CanDo(Ability.BackToTheFuture))
            {
                _menu.AddMenuListItem("Upgrade", "Back to the Future (toggle)", UpgradeMenu.ToggleBackToTheFuture);
            }

            if (Permission.CanDo(Ability.UltrabrightHeadlight))
            {
                _menu.AddMenuListItem("Upgrade", "Ultrabright headlight (toggle)", UpgradeMenu.ToggleUltrabrightHeadlight);
            }

            if (Permission.CanDo(Ability.CargobobMagnet))
            {
                _menu.AddMenuListItem("Upgrade", "Cargobob magnet", UpgradeMenu.CargobobMagnet);
            }

            if (Permission.CanDo(Ability.CompressVehicle))
            {
                _menu.AddMenuListItem("Upgrade", "Compress vehicle", UpgradeMenu.CompressVehicle);
            }

            if (Permission.CanDo(Ability.AntiGravity))
            {
                _menu.AddMenuListItem("Upgrade", "Anti-gravity (toggle)", UpgradeMenu.ToggleAntiGravity);
            }

            if (Permission.CanDo(Ability.CustomHorn))
            {
                _menu.AddMenuListItem("Upgrade", "Custom horn ↕", _menu.Submenu <CustomHornMenu>().OpenMenu);
            }

            if (Permission.CanDo(Ability.TurboBoost))
            {
                _menu.AddMenuListItem("Upgrade", "Turbo Boost (toggle)", UpgradeMenu.ToggleTurboBoost);
            }

            if (Permission.CanDo(Ability.TurboBrake))
            {
                _menu.AddMenuListItem("Upgrade", "Turbo Brake (toggle)", UpgradeMenu.ToggleTurboBrake);
            }

            if (Permission.CanDo(Ability.RemoteControl))
            {
                _menu.AddMenuListItem("Upgrade", "Remote control (toggle)", UpgradeMenu.ToggleRemoteControl);
            }

            if (Permission.CanDo(Ability.JesusMode))
            {
                _menu.AddMenuListItem("Upgrade", "Jesus mode (toggle)", UpgradeMenu.ToggleJesusMode);
            }

            if (Permission.CanDo(Ability.Stabilizer))
            {
                _menu.AddMenuListItem("Upgrade", "Stabilizer (toggle)", UpgradeMenu.ToggleStabilizer);
            }
            #endregion

            #region Extra
            if (Permission.CanDo(Ability.OceanWaves))
            {
                _menu.AddMenuListItem("Extra", "Crazy ocean waves (toggle)", ExtraMenu.ToggleCrazyOceanWaves);
            }

            if (Permission.CanDo(Ability.RappelFromHeli))
            {
                _menu.AddMenuListItemAsync("Extra", "Rappel from heli", ExtraMenu.RappelFromHeli);
            }

            if (Permission.CanDo(Ability.EMP))
            {
                _menu.AddMenuListItemAsync("Extra", "EMP", Vehicles.EMP);
            }

            if (Permission.CanDo(Ability.SpawnTrashPed))
            {
                _menu.AddMenuListItemAsync("Extra", "Trash ped", ExtraMenu.SpawnTrashPed);
            }

            if (Permission.CanDo(Ability.Balloons))
            {
                _menu.AddMenuListItemAsync("Extra", "Balloons", ExtraMenu.Balloons);
            }

            if (Permission.CanDo(Ability.FreezePosition))
            {
                _menu.AddMenuListItem("Extra", "Freeze position (toggle)", ExtraMenu.FreezePosition);
            }
            #endregion
        }
Beispiel #4
0
        private static void SetupMenu()
        {
            if (Permission.CanDo(Ability.SpawnVehicle))
            {
                Hud.AddSubmenu("Spawn vehicle", async(vehicle) => await Vehicles.Spawn(vehicle), Config.VehicleList);
            }

            if (Permission.CanDo(Ability.SpawnProp))
            {
                Hud.AddSubmenu("Spawn prop", async(prop) => await Props.Spawn(prop), Config.PropList, 10);
            }

            if (Permission.CanDo(Ability.SpawnPocceCompanion))
            {
                Hud.AddMenuListItem("Spawn ped", "Pocce companion", PocceCompanion);
            }

            if (Permission.CanDo(Ability.SpawnPetCompanion))
            {
                Hud.AddMenuListItem("Spawn ped", "Pet companion", PetCompanion);
            }

            if (Permission.CanDo(Ability.SpawnPoccePassengers))
            {
                Hud.AddMenuListItem("Spawn ped", "Pocce passengers", PoccePassengers);
            }

            if (Permission.CanDo(Ability.SpawnTrashPed))
            {
                Hud.AddMenuListItem("Spawn ped", "Trash ped", SpawnTrashPed);
            }

            if (Permission.CanDo(Ability.Rope))
            {
                Hud.AddMenuListItem("Rope", "Closest ped", () => RopeClosest(Peds.Get(Peds.Filter.Dead | Peds.Filter.CurrentVehiclePassengers)));
                Hud.AddMenuListItem("Rope", "Closest vehicle", () => RopeClosest(Vehicles.Get()));
                Hud.AddMenuListItem("Rope", "Closest vehicle tow", () => RopeClosest(Vehicles.Get(), true));
                Hud.AddMenuListItem("Rope", "Closest prop", () => RopeClosest(Props.Get()));
            }

            if (Permission.CanDo(Ability.RopeGun))
            {
                Hud.AddMenuListItem("Rope", "Equip rope gun", () => Ropes.EquipRopeGun());
            }

            if (Permission.CanDo(Ability.RappelFromHeli))
            {
                Hud.AddMenuListItem("Rope", "Rappel from heli", () => RappelFromHeli());
            }

            if (Permission.CanDo(Ability.Rope) || Permission.CanDo(Ability.RopeGun))
            {
                Hud.AddMenuListItem("Clear", "Ropes", () => Ropes.ClearAll());
                Hud.AddMenuListItem("Clear", "Last rope", () => Ropes.ClearLast());
            }

            if (Permission.CanDo(Ability.SpawnProp))
            {
                Hud.AddMenuListItem("Clear", "Props", () => Props.ClearAll());
                Hud.AddMenuListItem("Clear", "Last prop", () => Props.ClearLast());
            }

            if (Permission.CanDo(Ability.TeleportToClosestVehicle))
            {
                Hud.AddMenuListItem("Teleport", "Closest vehicle", () => TeleportToClosestVehicle());
                Hud.AddMenuListItem("Teleport", "Closest vehicle as passenger", () => TeleportToClosestVehicle(true));
            }

            if (Permission.CanDo(Ability.OceanWaves))
            {
                Hud.AddMenuListItem("Ocean waves", "High", () => API.SetWavesIntensity(8f));
                Hud.AddMenuListItem("Ocean waves", "Mid", () => API.SetWavesIntensity(2f));
                Hud.AddMenuListItem("Ocean waves", "Low", () => API.SetWavesIntensity(0f));
                Hud.AddMenuListItem("Ocean waves", "Reset", () => API.ResetWavesIntensity());
            }

            if (Permission.CanDo(Ability.PocceRiot))
            {
                Hud.AddMenuListItem("Riot", "Pocce riot", async() => await PocceRiot(false));
            }

            if (Permission.CanDo(Ability.PocceRiotArmed))
            {
                Hud.AddMenuListItem("Riot", "Armed pocce riot", async() => await PocceRiot(true));
            }

            if (Permission.CanDo(Ability.PedRiot))
            {
                Hud.AddMenuListItem("Riot", "Ped riot", async() => await PedRiot(false));
            }

            if (Permission.CanDo(Ability.PedRiotArmed))
            {
                Hud.AddMenuListItem("Riot", "Armed ped riot", async() => await PedRiot(true));
            }

            if (Permission.CanDo(Ability.Autopilot))
            {
                Hud.AddMenuListItem("Other", "Autopilot", Autopilot.Toggle);
            }

            if (Permission.CanDo(Ability.EMP))
            {
                Hud.AddMenuListItem("Other", "EMP", () => Vehicles.EMP());
            }

            if (Permission.CanDo(Ability.CargobobMagnet))
            {
                Hud.AddMenuListItem("Other", "Cargobob magnet", () => CargobobMagnet());
            }

            if (Permission.CanDo(Ability.IdentifySkins))
            {
                if (Permission.CanDo(Ability.ChangeSkin))
                {
                    var skins = new DataSource <string>();
                    Hud.AddMenuItem("Indentify skins", () => skins.Push(IdentifyPedModels()));
                    Hud.AddSubmenu("Change skin", async(skin) => await ChangeSkin(skin), skins);
                }
                else
                {
                    Hud.AddMenuItem("Indentify skins", () => IdentifyPedModels());
                }
            }

            var menukey = Config.GetConfigInt("MenuKey");

            if (menukey > 0)
            {
                Hud.SetMenuKey(menukey);
            }
        }