Пример #1
0
 public static void RopeClosest(IEnumerable <int> entities, bool tow = false)
 {
     if (Common.GetClosestEntity(entities, out int closest))
     {
         Ropes.PlayerAttach(closest, tow);
     }
     else
     {
         Hud.Notification("Nothing in range");
     }
 }
Пример #2
0
        public static async Task Balloons()
        {
            var player = Common.GetPlayerPedOrVehicle();
            var coords = Common.GetEntityTopCoords(player);

            coords.Z += 0.5f;

            var balloon = await Props.SpawnBalloons(coords);

            Ropes.Attach(player, balloon, Vector3.Zero, Vector3.Zero);
            API.SetEntityAsNoLongerNeeded(ref balloon);
        }
Пример #3
0
 public void RemoveJoint(object shape)
 {
     if (shape is Rope)
     {
         Ropes.Remove((Rope)shape);
     }
     else if (shape is RevoluteJoint)
     {
         RevoluteJoints.Remove((RevoluteJoint)shape);
     }
     else if (shape is PrismaticJoint)
     {
         PrismaticJoints.Remove((PrismaticJoint)shape);
     }
     else if (shape is WeldJoint)
     {
         WeldJoints.Remove((WeldJoint)shape);
     }
 }
Пример #4
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);
            }
        }