コード例 #1
0
        public Client()
        {
            if (Config.GetConfigBool("spawn_vehicle"))
            {
                Hud.AddSubmenu("Spawn vehicle", async(vehicle) => await Vehicles.Spawn(vehicle), Config.VehicleList);
            }

            if (Config.GetConfigBool("spawn_prop"))
            {
                Hud.AddSubmenu("Spawn prop", async(prop) => await Props.Spawn(prop), Config.PropList, 10);
            }

            if (Config.GetConfigBool("spawn_ped"))
            {
                Hud.AddMenuListItem("Spawn ped", async(spawn) =>
                {
                    switch (spawn)
                    {
                    case 0:
                        await PocceCompanion();
                        break;

                    case 1:
                        await PetCompanion();
                        break;

                    case 2:
                        await PoccePassengers();
                        break;

                    case 3:
                        await SpawnTrashPed();
                        break;
                    }
                }, "Pocce companion", "Pet companion", "Pocce passengers", "Trash ped");
            }

            if (Config.GetConfigBool("rope"))
            {
                Hud.AddMenuListItem("Rope", (tow) =>
                {
                    switch (tow)
                    {
                    case 0:
                        RopeClosest(Peds.Get(Peds.Filter.Dead | Peds.Filter.CurrentVehiclePassengers));
                        break;

                    case 1:
                        RopeClosest(Vehicles.Get());
                        break;

                    case 2:
                        RopeClosest(Vehicles.Get(), true);
                        break;

                    case 3:
                        RopeClosest(Props.Get());
                        break;

                    case 4:
                        RappelFromHeli();
                        break;
                    }
                    return(Delay(0));
                }, "Closest ped", "Closest vehicle", "Closest vehicle tow", "Closest prop", "Rappel from heli");
            }

            if (Config.GetConfigBool("rope") || Config.GetConfigBool("spawn_prop"))
            {
                Hud.AddMenuListItem("Clear", (clear) =>
                {
                    switch (clear)
                    {
                    case 0:
                        Ropes.ClearAll();
                        break;

                    case 1:
                        Ropes.ClearLast();
                        break;

                    case 2:
                        Props.ClearAll();
                        break;

                    case 3:
                        Props.ClearLast();
                        break;
                    }
                    return(Delay(0));
                }, "Ropes", "Last rope", "Props", "Last prop");
            }

            if (Config.GetConfigBool("teleport"))
            {
                Hud.AddMenuListItem("Teleport", (teleport) =>
                {
                    switch (teleport)
                    {
                    case 0:
                        TeleportToClosestVehicle();
                        break;

                    case 1:
                        TeleportToClosestVehicle(true);
                        break;
                    }
                    return(Delay(0));
                }, "Closest vehicle", "Closest vehicle as passenger");
            }

            if (Config.GetConfigBool("wave"))
            {
                Hud.AddMenuListItem("Ocean waves", (waves) =>
                {
                    switch (waves)
                    {
                    case 0:
                        API.SetWavesIntensity(8f);
                        break;

                    case 1:
                        API.SetWavesIntensity(2f);
                        break;

                    case 2:
                        API.SetWavesIntensity(0f);
                        break;

                    case 3:
                        API.ResetWavesIntensity();
                        break;
                    }
                    return(Delay(0));
                }, "High", "Mid", "Low", "Reset");
            }

            if (Config.GetConfigBool("riot"))
            {
                Hud.AddMenuListItem("Riot", async(riot) =>
                {
                    switch (riot)
                    {
                    case 0:
                        await PocceRiot(false);
                        break;

                    case 1:
                        await PocceRiot(true);
                        break;

                    case 2:
                        await PedRiot(false);
                        break;

                    case 3:
                        await PedRiot(true);
                        break;
                    }
                }, "Pocce riot", "Armed pocce riot", "Ped riot", "Armed ped riot");
            }

            if (Config.GetConfigBool("other"))
            {
                Hud.AddMenuListItem("Other", async(other) =>
                {
                    switch (other)
                    {
                    case 0:
                        await Autopilot.Toggle();
                        break;

                    case 1:
                        Vehicles.EMP();
                        break;

                    case 2:
                        CargobobMagnet();
                        break;
                    }
                }, "Autopilot", "EMP", "Cargobob magnet");
            }

            if (Config.GetConfigBool("skin"))
            {
                var skins = new DataSource <string>();
                Hud.AddMenuItem("Indentify skins", () => { skins.Push(IdentifyPedModels()); return(Delay(0)); });
                Hud.AddSubmenu("Change skin", async(skin) => await ChangeSkin(skin), skins);
            }

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

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