> 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-telegram/telegraph-offices.md).

# Telegraph offices

Telegraph offices in CAS Telegram — make players wire anywhere, only send from an office, or only open the device at one, plus blips, distance and adding offices.

Twelve offices are set up already, with their map positions. You decide whether standing at one matters.

## Choosing a mode

```lua
Config.OfficeMode = 'never'   -- 'never' | 'send' | 'always'
```

| Mode     | What players can do                                                    |
| -------- | ---------------------------------------------------------------------- |
| `never`  | Open and send anywhere. This is the default.                           |
| `send`   | Read wires and receive notices anywhere, but only send from an office. |
| `always` | The device only opens at an office.                                    |

`send` is the middle ground. Players keep everything they were reading and only have to ride in to answer, which is how a telegram actually worked.

{% hint style="warning" %}
`always` shuts the marketplace, circles, and live conversation behind twelve map points. It suits a slow roleplay server and gets in the way on a busy one. Try `send` first.
{% endhint %}

The rule is checked on the server against the player's real position, so it cannot be worked around from the client.

## Distance

```lua
Config.OfficeRadius = 3.0
```

How close, in metres, counts as being at the office.

## Blips and prompts

```lua
Config.OfficeBlips = true
Config.OfficeBlipSprite = 1475382911
Config.OfficePrompt = true
```

Blips are drawn whichever mode you pick, so players can find an office even when the device works everywhere. Set `Config.OfficeBlips` to `false` to remove them.

The prompt is the line of text shown while standing at an office. It only appears when `Config.OfficeMode` is not `never`.

## The offices themselves

```lua
Config.Offices = {
    { prefix = 'VAL', town = 'Valentine',   x = -179.0,  y = 626.0,    z = 113.0 },
    { prefix = 'RHO', town = 'Rhodes',      x = 1289.91, y = -1300.89, z = 77.04 },
    ...
}
```

`prefix` becomes the start of every number that office issues, for example `VAL-0417`. `town` is printed on the card in the exchange.

### Adding an office

Add a line with a new prefix, the town name, and the coordinates. Numbers with that prefix start being issued after a restart.

### Removing an office

Delete its line. Numbers already issued with that prefix keep working. If you are using `send` or `always`, make sure there is still an office near where your players actually are.

{% hint style="info" %}
An office with no coordinates still issues numbers. It simply never counts as somewhere a player is standing.
{% endhint %}
