> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-advanced-taxi-job/configuration.md).

# Configuration

Every setting in the CAS Advanced Taxi Job config.lua with its default value and what it does.

All gameplay settings are in `config.lua`. Every line there carries a short description. Restart the resource after a change (`ensure cas-taxi`). Server only settings, such as the Discord log, are in `config_server.lua`: see [Server settings](/script-documentation/cas-advanced-taxi-job/server-config.md). Offices, places and board maps: see [Offices and towns](/script-documentation/cas-advanced-taxi-job/offices-and-towns.md).

## General

| Setting     | Default                          | Description                                                                                           |
| ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `Framework` | `'auto'`                         | `'auto'` uses `vorp_core` when it runs, else `rsg-core`. Set `'vorp'` or `'rsg'` to force one.        |
| `Locale`    | `'en'`                           | Language file in `locales/`. `'en'` and `'tr'` are included.                                          |
| `JobLock`   | `false`                          | A job name such as `'taxi'` lets only that job start a shift. `false` lets anyone drive.              |
| `RateLimit` | `{ PerSecond = 4.0, Burst = 8 }` | Requests one player may send per second, and in a burst. Extra requests are refused with *Slow down.* |

## Keys

| Setting         | Default          | Description                                                                        |
| --------------- | ---------------- | ---------------------------------------------------------------------------------- |
| `Keys.Interact` | `0xCEFD9220` (E) | Prompt key for the office, the telegraph counter and hailing. A game control hash. |
| `Keys.Flag`     | `'J'`            | Flag up and down on cabs that are not CAS RedM Cars cars.                          |
| `Keys.Accept`   | `'Y'`            | Take the call on the wire.                                                         |
| `Keys.Decline`  | `'N'`            | Pass on the call.                                                                  |
| `Keys.EndFare`  | `'K'`            | Put the passenger out and end the fare.                                            |
| `Keys.Board`    | `'F6'`           | Dispatch board while stopped in the cab.                                           |
| `Keys.Cancel`   | `'X'`            | Passenger: cancel the cab they called.                                             |

## Marker

The diamond over the pickup and the drop. It is drawn by the game, so it stays on its spot when the camera turns.

| Setting              | Default           | Description                                        |
| -------------------- | ----------------- | -------------------------------------------------- |
| `Marker.Enabled`     | `true`            | `false` hides it. The map route and the blip stay. |
| `Marker.Size`        | `0.012`           | Size on screen, as a share of the screen width.    |
| `Marker.Height`      | `2.2`             | Metres above the spot.                             |
| `Marker.HideWithin`  | `8.0`             | Hidden when you are this close.                    |
| `Marker.MaxDistance` | `1500.0`          | Hidden when you are farther than this.             |
| `Marker.Font`        | `1`               | Game font id for the place name.                   |
| `Marker.NameScale`   | `0.32`            | Place name text size.                              |
| `Marker.SubScale`    | `0.22`            | Distance text size.                                |
| `Marker.Pickup`      | `{ 19, 17, 17 }`  | Fill colour at the pickup (RGB).                   |
| `Marker.Dest`        | `{ 179, 20, 27 }` | Fill colour at the drop (RGB).                     |

## Cab

| Setting           | Default                                                | Description                                                                                                                                                                                                                                       |
| ----------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Cab.Model`       | `'c10p_tremont'`                                       | Vehicle rented out at the offices: the Tremont Taxicab from CAS RedM Cars.                                                                                                                                                                        |
| `Cab.Label`       | `'Tremont Taxicab'`                                    | Name shown in the office.                                                                                                                                                                                                                         |
| `Cab.Paint`       | `'cabyellow'`                                          | CAS RedM Cars paint for rented cabs.                                                                                                                                                                                                              |
| `Cab.PlatePrefix` | `'T '`                                                 | Rented cabs get plates like `T 418` (CAS RedM Cars).                                                                                                                                                                                              |
| `Cab.FirstNumber` | `400`                                                  | Cab numbers count up from here.                                                                                                                                                                                                                   |
| `Cab.Stats`       | `{ Speed = 6, Comfort = 8, Fuel = 9, Condition = 10 }` | Bars shown in the office, out of 10.                                                                                                                                                                                                              |
| `Vehicles`        | the Tremont                                            | Models that count as cabs. `RearSeats` are the left and right rear seats (a passenger takes the side they stand on), `RearDoors` the CAS RedM Cars door parts opened for NPC passengers, `DoorSpot` where a passenger stands to open a rear door. |

## Rent

| Setting                  | Default | Description                                                                                             |
| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------- |
| `Rent.Deposit`           | `5.0`   | Cash taken when a company cab is rented.                                                                |
| `Rent.SpawnTimeoutMs`    | `20000` | If the cab never appears, the deposit is paid back.                                                     |
| `Rent.AbandonSec`        | `10`    | Pressing End shift twice within this many seconds away from the stand gives up the cab and its deposit. |
| `Rent.BindRadius`        | `80.0`  | A spawned cab must be this close to the stand.                                                          |
| `Rent.RefundOnLoss`      | `0.0`   | Share of the deposit paid back when the cab is lost or the driver leaves.                               |
| `Rent.Refund.HealthFull` | `80.0`  | Engine at or above this % pays the whole deposit back.                                                  |
| `Rent.Refund.HealthZero` | `30.0`  | Engine at or below this % pays nothing back. In between, the refund falls in a straight line.           |
| `Rent.Refund.FuelPrice`  | `0.05`  | Taken off the refund for every missing litre of fuel.                                                   |

## Own cabs

| Setting                | Default         | Description                                                                                                                                                                                                |
| ---------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Own.Enabled`          | `true`          | Drivers may work in their own cab.                                                                                                                                                                         |
| `Own.MinRank`          | `2`             | Rank (index in `Config.Ranks`) needed for it.                                                                                                                                                              |
| `Own.Source`           | `'auto'`        | `'dealership'`: only Tremonts bought from cas-dealership and taken out with cas-garage. `'any'`: any cab model nearby that cas-taxi did not spawn. `'auto'`: dealership when both resources run, else any. |
| `Own.DealershipModels` | `{ 'tremont' }` | cas-dealership catalogue ids that count as cabs.                                                                                                                                                           |
| `Own.Radius`           | `60.0`          | The own cab must be this close to the office.                                                                                                                                                              |

## Cut

| Setting      | Default | Description                                             |
| ------------ | ------- | ------------------------------------------------------- |
| `Cut.Rented` | `0.30`  | Share of each fare kept by the company in a rented cab. |
| `Cut.Own`    | `0.15`  | The same in an own cab.                                 |

## Fare

| Setting                 | Default    | Description                                                                                                                       |
| ----------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `Fare.FlagFall`         | `0.50`     | Charged when the meter starts.                                                                                                    |
| `Fare.PerQuarter`       | `0.10`     | Every quarter mile after the included ones.                                                                                       |
| `Fare.IncludedQuarters` | `2`        | Quarter miles covered by the flag fall.                                                                                           |
| `Fare.PerWait4Min`      | `0.10`     | Every full 4 minutes standing still with the passenger aboard.                                                                    |
| `Fare.NightMultiplier`  | `1.5`      | Night tariff, for drivers with the night perk.                                                                                    |
| `Fare.NightHours`       | `{ 0, 5 }` | Night tariff from, to (game hours, wraps past midnight).                                                                          |
| `Fare.NightClock`       | `'client'` | weathersync's clock is used when it runs. Otherwise `'client'` trusts the driver's game clock and `'server'` uses the real clock. |
| `Fare.MinFare`          | `0.50`     | No fare is less than this.                                                                                                        |
| `Fare.TipMax`           | `0.50`     | Best possible NPC tip as a share of the fare.                                                                                     |

## Dispatch

| Setting                     | Default      | Description                                                                                                                 |
| --------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------- |
| `Dispatch.Npc`              | `true`       | NPC passengers call cabs. `false` leaves only player calls.                                                                 |
| `Dispatch.Interval`         | `{ 25, 60 }` | Seconds between new NPC calls while a driver is free.                                                                       |
| `Dispatch.MaxOpen`          | `3`          | Open NPC calls per office at once.                                                                                          |
| `Dispatch.CallLifeSec`      | `120`        | An untaken call disappears after this.                                                                                      |
| `Dispatch.AcceptSeconds`    | `15`         | Time to answer a call on the wire.                                                                                          |
| `Dispatch.OfferRadius`      | `1500.0`     | Calls go to free cabs within this many metres of the pickup.                                                                |
| `Dispatch.MinMiles`         | `0.17`       | Shortest trip.                                                                                                              |
| `Dispatch.MinPickupMetres`  | `220`        | A new NPC call is picked up at least this far from the free cab it goes to, so passengers do not appear next to the driver. |
| `Dispatch.RouteFactor`      | `1.3`        | Straight line to street distance, for the estimate.                                                                         |
| `Dispatch.LongChance`       | `0.25`       | Chance that a long haul passenger asks to leave town.                                                                       |
| `Dispatch.NpcSpawnDistance` | `120.0`      | The NPC passenger appears when the driver is this close.                                                                    |
| `Dispatch.BoardRadius`      | `14.0`       | Stop this close to the passenger to pick them up.                                                                           |
| `Dispatch.DropRadius`       | `18.0`       | Stop this close to the destination to drop them.                                                                            |
| `Dispatch.PickupGraceSec`   | `120`        | Patience only starts to drop after this.                                                                                    |
| `Dispatch.ExpectedSpeed`    | `7.0`        | Metres per second a fare expects on average.                                                                                |
| `Dispatch.MaxSpeed`         | `30.0`       | Teleport guard: a jump of more than 1.5 times this in one second is not counted.                                            |
| `Dispatch.WaitSpeed`        | `0.5`        | Slower than this per second counts as waiting.                                                                              |

## Patience and comfort

| Setting                | Default | Description                                                        |
| ---------------------- | ------- | ------------------------------------------------------------------ |
| `Patience.PerMinLate`  | `20.0`  | Patience lost per minute late to the pickup.                       |
| `Patience.PerMinSlow`  | `15.0`  | Patience lost per minute the ride runs slower than expected.       |
| `Patience.SlackFactor` | `1.4`   | How much slower than expected a ride may be before patience drops. |
| `Patience.SlackSec`    | `30`    | Extra seconds of slack on every ride.                              |
| `Comfort.PerBump`      | `12.0`  | Comfort lost per full bump, times the passenger's sensitivity.     |
| `Comfort.SayAbove`     | `0.45`  | Bump size that makes the passenger speak.                          |
| `Comfort.HardAccel`    | `6.0`   | A speed change of this many m/s per second counts as a jolt.       |

## Dispatch board

| Setting              | Default        | Description                                                                                                                                                                                    |
| -------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Board.OfficeRadius` | `6.0`          | The board also opens from the office menu when the driver stands this close to the counter.                                                                                                    |
| `Board.MapTiles`     | Rockstar's map | The board map: the game's own map, loaded live from Rockstar's map server. `false` uses the map pictures that ship with the script (they also show while the tiles load, or without internet). |
| `Board.MapZoom`      | `7`            | Tile zoom of the live map. 7 is the sharpest; 6 or 5 load fewer tiles.                                                                                                                         |

## Calls from players

| Setting                  | Default                     | Description                                                                                          |
| ------------------------ | --------------------------- | ---------------------------------------------------------------------------------------------------- |
| `Calls.Command`          | `'taxi'`                    | Chat command that opens the wire form near a cab office. `false` leaves only the telegraph counters. |
| `Calls.Radius`           | `1000.0`                    | The command works within this many metres of a cab office.                                           |
| `Calls.Telegraphs`       | Saint Denis station         | Telegraph counters where players wire for a cab: `{ Office = 'stdenis', Coords = vector3(...) }`.    |
| `Calls.TelegraphRadius`  | `2.0`                       | How close to stand at a telegraph counter.                                                           |
| `Calls.NameRadius`       | `60.0`                      | A named place this close gives the pickup its name.                                                  |
| `Calls.WireFee`          | `0.05`                      | Cost of a wire, taken when it is sent. Hailing is free.                                              |
| `Calls.Cooldown`         | `30`                        | Seconds before the same player may wire again.                                                       |
| `Calls.NoteMax`          | `60`                        | Longest note for the driver.                                                                         |
| `Calls.WaypointMaxMiles` | `3.0`                       | A map waypoint farther than this from the pickup is refused.                                         |
| `Calls.Hail`             | `true`                      | Players on foot may hail a cab that has its flag up.                                                 |
| `Calls.HailDistance`     | `12.0`                      | How close the cab must be to hail it.                                                                |
| `Calls.MinMeterSec`      | `20`                        | A passenger who leaves before the meter ran this long pays nothing.                                  |
| `Calls.LeaveDistance`    | `8.0`                       | A passenger this far from the cab has left it.                                                       |
| `Calls.PayTimeout`       | `45`                        | Seconds to settle a fare before the meter fare is taken with no tip.                                 |
| `Calls.Tips`             | `{ 0.0, 0.25, 0.50, 1.00 }` | Tip choices on the fare slip.                                                                        |
| `Calls.DefaultRating`    | `4`                         | Stars given when the passenger does not choose.                                                      |
| `Calls.DriverPortrait`   | `'cowboy'`                  | Portrait passengers see for their driver.                                                            |

## Ticket

| Setting          | Default | Description                                                            |
| ---------------- | ------- | ---------------------------------------------------------------------- |
| `Ticket.Seconds` | `9`     | How long the printed fare ticket stays up.                             |
| `Ticket.Year`    | `1907`  | Year printed on the ticket. Day and month come from the server's date. |

## Ranks

```lua
Config.Ranks = {
    { Label = 'Cabbie, third class', MinFares = 0, MinRating = 0.0, Perks = {} },
    { Label = 'Cabbie, second class', MinFares = 20, MinRating = 3.5, Perks = { night = true } },
    { Label = 'Cabbie, first class', MinFares = 60, MinRating = 3.8, Perks = { night = true, vip = true } },
    { Label = 'Senior cabbie', MinFares = 150, MinRating = 4.2, Perks = { night = true, vip = true, long = true } },
}
```

| Field       | Description                                                                                                                 |
| ----------- | --------------------------------------------------------------------------------------------------------------------------- |
| `Label`     | Rank name shown in the office and on promotion.                                                                             |
| `MinFares`  | Fares needed.                                                                                                               |
| `MinRating` | Average rating needed.                                                                                                      |
| `Perks`     | `night` (night tariff), `vip` (VIP passengers), `long` (long hauls out of town). The own cab perk comes from `Own.MinRank`. |

Ranks are reached in order and never go down. Add, remove or rename ranks freely; keep the first one at `MinFares = 0`.

## Passengers

```lua
{ Id = 'lady', Models = { 'a_f_m_nbxupperclass_01' }, Portrait = 'lady', Tone = 'posh', Weight = 2, Tip = 1.4, Sensitivity = 1.4, Vip = true,
  Names = { 'Mrs. Eleanor Whitlock', 'Mrs. Adelaide Brennan', 'Miss Clara Fontaine', 'Mrs. Harriet Vance' } },
```

| Field         | Description                                                                                     |
| ------------- | ----------------------------------------------------------------------------------------------- |
| `Id`          | Unique id.                                                                                      |
| `Models`      | Ped models; one is picked per call.                                                             |
| `Portrait`    | Painted portrait in the NUI: `lady`, `gent`, `worker`, `priest`, `newsboy` or `cowboy`.         |
| `Tone`        | Which voice lines they use: `posh`, `common` or `clergy` (`say_<tone>_*` in the language file). |
| `Weight`      | How often they call, against the others.                                                        |
| `Tip`         | Tip factor. 1.0 is average.                                                                     |
| `Sensitivity` | How much bumps upset them. 1.0 is average.                                                      |
| `Vip`         | Only drivers with the `vip` perk get these calls.                                               |
| `Long`        | May ask for a long haul out of town (drivers with the `long` perk).                             |
| `Names`       | Names picked at random for each call.                                                           |
