示例#1
0
        public DestinationMenu()
        {
            MenuController.AddMenu(DestMenu);

            // Create default menu items
            DestMenu.AddMenuItem(new MenuItem("Waypoint", "Set your waypoint as your destination.")
            {
                Enabled = true,
            });

            // Destination Menu events
            DestMenu.OnItemSelect += (_menu, _item, _index) =>
            {
                Taxi currTaxi = TaxiHandler.GetCurrentPlayerTaxi(Game.Player);
                if (currTaxi != null)
                {
                    if (Game.IsWaypointActive)
                    {
                        currTaxi.DriveTo(World.WaypointPosition);
                    }
                    else
                    {
                        _item.Description = "You must set a waypoint first!";
                    }
                }
            };

            DestMenu.OnMenuClose += (_menu) =>
            {
                _menu.GetMenuItems()[0].Description = "Set your waypoint as your destination.";
            };
        }
示例#2
0
        private async void CreateTaxi(VehicleHash vehicle, PedHash driver, Vector3 position)
        {
            // Set up entities
            this.vehicle = await World.CreateVehicle(vehicle, position);

            this.driver = await World.CreatePed(driver, position);

            this.driver.SetIntoVehicle(this.vehicle, VehicleSeat.Driver);

            // Add object to Taxi Handler
            TaxiHandler.AddTaxiToHandler(this);
            this.taxiStatus = TaxiStatus.OPEN;
        }