> 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/ranks-and-pay.md).

# Ranks and pay

How CAS Advanced Taxi Job works out fares, tips, the company cut, star ratings and the four driver ranks.

Everything here is worked out on the server. The values are in `config.lua`.

## The fare

```
quarters = miles x 4, rounded up
fare     = flag fall
         + per quarter x (quarters - included quarters)
         + per 4 minutes waiting x (whole 4 minute blocks of waiting)
fare     = fare x night tariff (drivers with the night perk, at night)
fare     = at least the minimum fare
```

| Setting           | Default                                                                 |
| ----------------- | ----------------------------------------------------------------------- |
| `FlagFall`        | $0.50, covers the first 2 quarter miles (`IncludedQuarters`)            |
| `PerQuarter`      | $0.10                                                                   |
| `PerWait4Min`     | $0.10 for every full 4 minutes standing still with the passenger aboard |
| `NightMultiplier` | 1.5, from 00:00 to 05:00 game time (`NightHours`)                       |
| `MinFare`         | $0.50                                                                   |

Distance is the real distance the cab drives. A jump of more than one and a half times `Dispatch.MaxSpeed` in a second (45 m with the default 30) is not counted and the fare is marked (teleport guard). Moving slower than 0.5 m per second counts as waiting.

The night tariff reads the synced game clock when `weathersync` runs. Otherwise `NightClock = 'client'` uses the driver's game clock and `'server'` the server's real clock.

## Tips and stars from NPC passengers

Each passenger has a comfort and a patience from 0 to 100. Comfort drops on bumps and hard braking, more for sensitive passengers such as the hotel ladies. Patience drops when the cab is late to the pickup or slower than they expect.

```
tip   = fare x 0.50 x passenger's tip x (comfort / 100) ^ 1.5 x (patience / 100)
stars = 5 x (0.6 x comfort + 0.4 x patience) / 100, rounded, from 1 to 5
```

A fare with a teleport pays no tip, gives no stars and does not count towards the rank.

An NPC who is put out early with **K** pays nothing and gives 1 star; one who gives up waiting at the pickup gives 2 stars. Both count in the driver's average rating, not in the fares.

## Player passengers

Player passengers choose their own tip and stars on the fare slip. See [Riding as a passenger](/script-documentation/cas-advanced-taxi-job/passengers.md).

## The company cut

The company keeps a share of the fare, not of the tip:

| Cab                | Cut                       |
| ------------------ | ------------------------- |
| Rented company cab | 30% (`Config.Cut.Rented`) |
| Own cab            | 15% (`Config.Cut.Own`)    |

The driver gets `fare - cut + tip` in cash at once.

## Ranks

A rank is reached by the number of fares and the average rating. Ranks never go down.

| Rank                 | Fares | Rating | Perks                                                         |
| -------------------- | ----- | ------ | ------------------------------------------------------------- |
| Cabbie, third class  | 0     | any    |                                                               |
| Cabbie, second class | 20    | 3.5    | Night tariff, own cab                                         |
| Cabbie, first class  | 60    | 3.8    | Night tariff, VIP passengers, own cab                         |
| Senior cabbie        | 150   | 4.2    | Night tariff, VIP passengers, long hauls out of town, own cab |

The own cab rank is `Config.Own.MinRank` (2). A promotion shows on the driving HUD and in a notification.
