Beispiel #1
0
    private void SublimeTeleportMenu()
    {
        List <IMenuItem> teleportMenuItems = new List <IMenuItem>();

        var buttonTeleportToMarker = new MenuButton("Marker");

        buttonTeleportToMarker.Activated += (sender, args) => PlayerFunctions.TeleportToMarker();
        teleportMenuItems.Add(buttonTeleportToMarker);

        Dictionary <string, Vector3> teleportDict = new Dictionary <string, Vector3>()
        {
            { "Michael's House", new Vector3(-852.4f, 160.0f, 65.6f) },
            { "Franklin's House", new Vector3(7.9f, 548.1f, 175.5f) },
            { "Franklin's Aunt", new Vector3(-14.8f, -1454.5f, 30.5f) },
            { "Trevor's Trailer", new Vector3(1985.7f, 3812.2f, 32.2f) },
            { "Airport Entrance", new Vector3(-1034.6f, -2733.6f, 13.8f) },
            { "Airport Field", new Vector3(-1336.0f, -3044.0f, 13.9f) },
            { "Elysian Island", new Vector3(338.2f, -2715.9f, 38.5f) },
            { "Jetsam", new Vector3(760.4f, -2943.2f, 5.8f) },
            { "Strip Club", new Vector3(127.4f, -1307.7f, 29.2f) },
            { "Elburro Heights", new Vector3(1384.0f, -2057.1f, 52.0f) },
            { "Ferris Wheel", new Vector3(-1670.7f, -1125.0f, 13.0f) },
            { "Chumash", new Vector3(-3192.6f, 1100.0f, 20.2f) },
            { "Windfarm", new Vector3(2354.0f, 1830.3f, 101.1f) },
            { "Military Base", new Vector3(-2047.4f, 3132.1f, 32.8f) },
            { "McKenzie Airfield", new Vector3(2121.7f, 4796.3f, 41.1f) },
            { "Desert Airfield", new Vector3(1747.0f, 3273.7f, 41.1f) },
            { "Chilliad", new Vector3(425.4f, 5614.3f, 766.5f) },
        };

        foreach (KeyValuePair <string, Vector3> location in teleportDict)
        {
            var buttonTeleportToLocation = new MenuButton(location.Key);
            buttonTeleportToLocation.Activated += (sender, args) => PlayerFunctions.TeleportToLocation(location);
            teleportMenuItems.Add(buttonTeleportToLocation);
        }

        TeleportMenu = new GTA.Menu("Teleport Options", teleportMenuItems.ToArray());
        DrawMenu(TeleportMenu);
    }