# Rides, Bites, Garage & Homes

Ride-hailing, food delivery, and the player's vehicles and homes, paid through Nova Wallet.

## Getting the apps

Rides, Bites, Garage and Homes are downloaded from Nova Store on Wolfden Phone and Wolfden Phone Pro. They are not available on Wolfden Phone Secure.

All four go online, so each action uses mobile data, or nothing on Wi-Fi. They act for the player's character, not the phone: whichever phone a player uses, they see their own trips, vehicles and homes, and money moves through their own [Nova Wallet](#/docs/wd_phone/wallet).

| App | What players can do | Needs a SIM |
| --- | --- | --- |
| **Rides** | Request a ride anywhere on the map, or switch on Driver mode and earn from trips | No. Only Message and Call to the other side use the SIM |
| **Bites** | Order food from restaurants, track it to the door, or deliver as a courier | To order. Couriers need none |
| **Garage** | See their vehicles, where they are and their condition, set GPS, and order a valet | No |
| **Homes** | See the properties they own or hold a key to, set GPS, and give or take back keys | No |

## Rides

**Requesting a ride.** The rider taps the map where they want to go and sees an estimated fare and how many drivers are free nearby, then requests the ride. The pickup is where the rider stands. The estimate has to fit the rider's Wallet: their balance, their card switched on and their daily limit.

**Driving.** Any player can switch on **Driver mode** in the Drive tab, unless you limit it to certain jobs. Free drivers sitting at the wheel near the pickup get the offer, nearest first, three at a time. An offer nobody takes moves on to the next drivers after 25 seconds, and a request nobody accepts is cancelled after three minutes. The first driver to accept gets the trip.

**The trip.** Both sides see each other on the map and as a blip, and the driver gets a waypoint to the pickup, then to the destination.

1. The driver taps **I'm here** once within 40 metres of the pickup.
2. The rider gets in the driver's vehicle and the driver taps **Start trip**.
3. The driver taps **End trip** at the destination.

**Message** and **Call** buttons contact the other side without showing a number in Rides. Once a conversation or call is open, Messages and the call screen show the number like any other.

**Paying.** The rider pays for the distance actually driven, never more than 50% above the estimate, from Nova Wallet when the trip ends. The driver gets the fare minus a 10% platform fee. A payment that fails stays owed: the rider pays it from **History**, and cannot request another ride until they do.

**Cancelling.** Cancelling is free while the request is open and for 60 seconds after a driver accepts. After that the rider pays a cancel fee of 15, or 30 once the driver has arrived. A driver who waited three minutes at the pickup can cancel, and the rider pays 30. Cancel fees go to the driver. A player who leaves the city before the rider is aboard cancels the trip without fees; once the trip is under way, leaving ends it and the rider pays for the distance driven so far.

**Ratings and history.** After a completed trip, rider and driver rate each other from 1 to 5 stars. Average ratings show on offers, trips and the Drive tab. **History** lists each player's trips as rider and as driver, with what they paid or earned.

### Configure Rides

Edit `Config.Rides` in `config/rides.lua`:

| Setting | Default | What it does |
| --- | --- | --- |
| `enabled` | `true` | Turns Rides on or off |
| `driverJobs` | `{}` (anyone) | Jobs allowed to drive, for example `{ 'taxi' }` |
| `requireOnDuty` | `false` | Drivers with one of `driverJobs` must be on duty |
| `requireLicence` | `false` | Drivers need a driver's licence from your framework |
| `offerRadius` | `3000.0` | How far from the pickup drivers get offers, in metres |
| `offerBatch` / `offerSeconds` | `3` / `25` | Drivers offered at a time, and how long an offer lasts |
| `requestTimeoutSeconds` | `180` | When a request nobody accepts is cancelled |
| `minTripMeters` / `maxTripMeters` | `150.0` / `15000.0` | Shortest and longest trip, in a straight line |
| `arriveRadius` | `40.0` | How close the driver must be to mark "arrived" |
| `requireRiderInVehicle` | `true` | The rider must sit in the driver's vehicle to start the trip |
| `platformFeePercent` | `10` | The share of each fare the driver does not get |
| `feeSharedAccount` | `nil` | A job or society account that receives the platform fee; `nil` keeps it nowhere |
| `cancel` | 60 s grace, 15, 30, 180 s | `graceSeconds`, `afterAccept`, `afterArrival` and `noShowSeconds` |

The fare is set in `fare`:

```lua config/rides.lua
fare = {
    base = 25,
    perKm = 18,
    minimum = 40,
    roadFactor = 1.3,
    maxMultiplier = 1.5,
},
```

The estimate is `base`, plus `perKm` for each kilometre in a straight line multiplied by `roadFactor`, and at least `minimum`. The final fare follows the distance driven, never more than the estimate times `maxMultiplier`.

With `requireLicence = true`, Qbox and QBCore check the driver licence in the character's licences, and ESX uses `esx_license`. The platform fee is charged through your economy setting; see [Wallet & payments](#/docs/wd_phone/wallet?section=carrier-shop-and-repair-charges).

## Bites

Bites is food ordering and delivery built on [Business](#/docs/wd_phone/productivity?section=marketplace-and-business). A Bites order is a Business order, so restaurant staff handle it in the Business app.

**Ordering.** The player picks a restaurant, fills a cart and chooses where to deliver: where they stand, or one of their saved places in Maps. They can leave a note for the restaurant. A restaurant is **Open** while it has staff on duty.

**Paying.** The customer pays the menu total plus the delivery fee from Nova Wallet when ordering, and the money is held. On delivery, the menu total goes to the restaurant and the delivery fee to the courier. Afterwards the customer can tip the courier once, within 30 minutes. A rejected, cancelled or undelivered order is refunded in full; an order nobody delivers is cancelled after 90 minutes.

**In the restaurant.** Staff accept the order, prepare it and mark it ready in the Business app's **Staff** tab. Rejecting an order refunds it.

**Delivering.** The restaurant's staff, and any player who turns on **Courier mode** in Bites, see ready orders in the Courier tab. The first to tap **Take it** gets the order, with waypoints to the pickup and the drop-off; the customer's address shows only to the courier holding the order. Nobody can deliver their own order. To mark it **Delivered**, the courier stands within 8 metres of the customer, who must be in the city. A courier who cannot finish taps **Hand back**, and the order returns to the list.

### Add a restaurant

Bites lists every business with `category = 'food'` that takes orders. `config/bites.lua` includes three example restaurants, Burger Shot, Pizza This and Cat Cafe, all turned off. To use one, set `enabled = true` and point `jobNames` at a job your server has:

```lua config/bites.lua
burgershot = {
    enabled = true,
    label = 'Burger Shot', icon = 'sandwich', color = '#e8562a',
    description = 'Burgers, fries and shakes, delivered hot.',
    jobNames = { 'burgershot' },
    invoiceAccountId = nil,
    delivery = { pickup = vector3(-1183.0, -884.0, 13.8), fee = 20 },
    products = {
        { id = 'bleeder', section = 'Burgers', label = 'The Bleeder', description = 'Double patty, cheese, pickles.', price = 18 },
        { id = 'fries', section = 'Sides', label = 'Fries', description = 'Salted, crispy.', price = 6 },
    },
},
```

- `delivery.pickup` is where couriers collect the order, and `delivery.fee` replaces the default delivery fee for this restaurant.
- Each product's `section` is its heading on the menu.
- `invoiceAccountId` is the restaurant's Wallet business account. Without one, the menu total goes to the employee who accepted the order.
- A food business in `Config.PhoneBusinesses` (`config/commerce.lua`), or one registered by another resource, also appears in Bites; see [Exports & integrations](#/docs/wd_phone/exports).

### Configure Bites

Edit `Config.Bites` in `config/bites.lua`:

| Setting | Default | What it does |
| --- | --- | --- |
| `enabled` | `true` | Turns Bites on or off |
| `deliveryFee` | `25` | Delivery fee when the restaurant sets none |
| `maxItems` / `maxQuantity` | `20` / `10` | Items in one cart, and of one menu item |
| `maxOrderTotal` | `5000` | The largest order, fee included |
| `maxActiveOrders` | `3` | Open orders per phone number |
| `openCouriers` | `true` | Any player can deliver in Courier mode; `false` leaves delivery to the restaurant's staff |
| `deliveryRadius` | `8.0` | How close the courier must be to the customer |
| `tipOptions` / `maxTip` | `{ 5, 10, 20 }` / `500` | Quick tip buttons, and the largest tip |
| `tipWindowMinutes` | `30` | How long after delivery the customer can tip |
| `expireMinutes` | `90` | When an undelivered order is cancelled and refunded |
| `deliverItems` | `{}` | Real items the customer receives on delivery |

By default Bites gives no items, and the food is handed over in roleplay. To give items on delivery, key them by restaurant and product:

```lua config/bites.lua
deliverItems = {
    ['burgershot:bleeder'] = { item = 'burger', count = 1 },
},
```

## Garage

Garage lists the character's vehicles from your garage resource: plate, model, whether it is **In the garage**, **Out** or **Impounded**, which garage or depot it is at, and its fuel, engine and body condition when your garage resource reports them.

- **Find vehicle** sets GPS to a vehicle that is out, at its live position. A vehicle left out that cannot be found must be collected from the depot.
- **GPS to garage** sets GPS to the garage a parked vehicle is in.
- **Valet** brings a parked vehicle to the nearest road. The attendant takes about 25 seconds, and the player is charged 250 when it arrives, or nothing if the delivery fails. Players get one valet at a time, with a two-minute wait between deliveries. The valet does not come to players inside an instanced interior or property, and impounded vehicles stay at the depot.

The phone stores nothing about vehicles. It asks your garage resource, so the app shows **No garage service** until a supported resource is running.

Edit `Config.Garage` in `config/garage.lua`:

| Setting | Default | What it does |
| --- | --- | --- |
| `provider` | `'auto'` | Which garage resource to use; see [Garage and housing resources](#garage-and-housing-resources) |
| `maxVehicles` | `60` | The most vehicles listed for one character |
| `valet.enabled` | `true` | Turns the valet on or off |
| `valet.fee` | `250` | The valet fee, charged on delivery |
| `valet.account` | `'bank'` | Pay from `bank` or `cash` |
| `valet.delaySeconds` | `25` | How long the attendant takes |
| `valet.cooldownSeconds` | `120` | Wait between deliveries, per character |
| `valet.mainWorldOnly` | `true` | No valet inside instanced interiors and property shells |
| `valet.allowImpounded` | `false` | Also deliver impounded vehicles |
| `valet.lockDoors` | `true` | Deliver the vehicle locked |

The valet fee is charged through your economy setting, so it is free with `wd_phone:economy "none"`; see [Wallet & payments](#/docs/wd_phone/wallet?section=carrier-shop-and-repair-charges).

## Homes

**Homes needs a housing provider.** No housing resource is connected out of the box, so the app shows **No housing service** until a developer registers a provider for yours; see [Garage and housing resources](#garage-and-housing-resources).

Homes lists the properties the character owns, under **Your homes**, and the ones they hold a key to, under **Keys you hold**. **GPS to entrance** sets a waypoint to the property.

Owners can give a key to a contact or a phone number, and take keys back. The phone with that number must be on and in the city; the new keyholder gets a notification. The owner sees keyholders by the number the key was given to, or by their own contact name for it, never by character name. A property can have up to 20 keyholders. Ghost Mobile numbers cannot be given a key.

Edit `Config.Homes` in `config/homes.lua`:

| Setting | Default | What it does |
| --- | --- | --- |
| `provider` | `'auto'` | Which housing resource to use; see [Garage and housing resources](#garage-and-housing-resources) |
| `maxHomes` | `30` | The most properties listed for one character |
| `maxKeyholders` | `20` | Keyholders per property |
| `notifyKeyholder` | `true` | Notify a player when they are given a key |

## Garage and housing resources

Garage and Homes read vehicles and properties through your garage and housing resources, never from their database tables.

| App | Works out of the box with | Otherwise |
| --- | --- | --- |
| Garage | Qbox: `qbx_vehicles`, with `qbx_garages` for garage names and GPS and `qbx_core` for model names and the valet | A provider for your garage resource |
| Homes | None | A provider for your housing resource |

With `provider = 'auto'`, the first available option in `autoOrder` is used, and a registered provider always comes first. Set `provider` to force one:

| Value | Uses |
| --- | --- |
| `'auto'` (default) | A registered provider, then for Garage the Qbox resources |
| `'qbx'` | Garage only: the Qbox resources |
| `'custom'` | Only a provider registered by another resource |
| `'none'` | Nothing: the app says no service is available |

Resources such as jg-advancedgarages, cd_garage, okokGarage, qbx_properties, ps-housing and bcs_housing are not connected automatically. A developer connects them, or any other resource, with a short provider; see [Exports & integrations](#/docs/wd_phone/exports). Without a provider that supports valet or keys, the app hides those buttons.

## Test before launch

1. Install Rides on two phones. Switch on Driver mode on one, sit at the wheel, and request a ride from the other. Complete the trip and check that both Wallets changed.
2. Turn on one example restaurant with a real job, order from it, accept and mark it ready in Business as an on-duty employee, then deliver it in Courier mode.
3. Open Garage with vehicles parked, out and impounded, and order a valet for a parked one.
4. Open Homes with your housing provider running, and give and take back a key.
