> 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-police-patrol-car-pack/siren-beacon-and-bell.md).

# Siren, beacon and bell

How the mechanical siren, the rotating red beacon and the warning bell of the CAS police cars work in RedM, who may use them, how to change the allowed jobs and how players rebind the keys.

The siren, the beacon and the bell are run by CAS RedM Cars (`cas-car1910`). The driver presses a key, the server checks the driver's job and switches the equipment on the car itself, so every player nearby hears the siren and sees the beacon.

## What each car has

| Car                   | Siren            | Red beacon | Warning bell |
| --------------------- | ---------------- | ---------- | ------------ |
| City Police Patrol    | Yes              | Yes        | Yes          |
| Sheriff County Patrol | Yes, twin rotors | Yes        | No           |
| Highway Patrol Pickup | Yes              | Yes        | No           |
| Police Transport Van  | Yes              | Yes        | No           |

## The keys

| Default key | What it does                             | Name in the key settings        |
| ----------- | ---------------------------------------- | ------------------------------- |
| **K**       | Siren on / off                           | Police car: siren on / off      |
| **L**       | Red beacon on / off                      | Police car: red beacon on / off |
| **B**       | Rings the bell once (City Police Patrol) | Police car: ring the bell       |

* Only the driver can use them. A passenger's key press does nothing.
* The siren and the beacon are switches: one press turns them on, the next turns them off. They stay on until the driver switches them off, also when the driver gets out.
* A second press within 0.6 s is ignored for the siren and the beacon, and the bell rings at most every 0.7 s.
* The keys do nothing while the pause menu or a NUI screen is open.

## The siren

* A mechanical motor siren. Switched on, it winds up and its howl rises and falls, because the motor is powered for 1.9 s and coasts for 1.9 s in turn. Switched off, it winds down.
* The siren rotor spins on the fender while it runs; the Sheriff car has two.
* Every player within 220 m hears it, coming from the siren on the car.

## The beacon

* A red light swept round by the reflector on the roof: a beam that lights the street around the car, best seen at night, and a glow in the lens.
* The beacon rotor turns on the roof. It spins up when switched on and slows to a stop when switched off.
* It is drawn for every player within 160 m of the car.

## The bell

* City Police Patrol only. Every press rings the brass warning bell once and swings its clapper on the car.
* The players near the car hear it.

## Who may use them

On every key press the server checks:

1. The player is in the **driver seat** of a police car that has this equipment.
2. **Staff:** a player with the ACE `command` may always use them while `staffAllowed` is `true`.
3. **Job:** otherwise the player's job must be in the `jobs` list. On VORP this is the character's job, on RSG the job name. Job names are compared in lower case; job grades are not checked.

The default jobs are `sheriff`, `police`, `marshal`, `deputy` and `lawman`.

A refused player gets the message *Only the sheriff and the police may work the siren, bell and beacon.* On VORP it shows as a tip on the right of the screen; on RSG it is printed in the player's F8 console.

## Changing the jobs

The jobs are set in CAS RedM Cars, not in the pack. Open `cas-car1910/shared/config.lua` (this file stays open in the escrow build), go to the `police` block at the end of the file and edit `jobs`:

```lua
    police = {
        jobs = { 'sheriff', 'police', 'marshal', 'deputy', 'lawman' },   -- jobs that may work the siren, bell and beacon
        staffAllowed = true,             -- the ACE 'command' (group.admin) also may (testing)
```

For example, to add a `ranger` job and drop `lawman`:

```lua
        jobs = { 'sheriff', 'police', 'marshal', 'deputy', 'ranger' },
```

Use the job names exactly as your framework stores them. Set `staffAllowed = false` if staff should not use the equipment without a law job. Restart the server afterwards: `cas-car1910` reads the list when it starts.

If you change the jobs, you may also want to change the refusal text `police_not_allowed` in `cas-car1910/locales/en.lua`, see [Configuration](/script-documentation/cas-police-patrol-car-pack/configuration.md#texts).

## Rebinding the keys

* **Every player** can rebind the three keys in the game's key binding settings, under the names in the table above.
* **The server's default keys** are `keys` in the same `police` block: `{ siren = 'K', beacon = 'L', bell = 'B' }`. The game remembers each player's binding, so players who joined before a change may keep the old key until they set it in the key settings.
* The keys are the commands `+c1910_siren`, `+c1910_beacon` and `+c1910_bell`. They are registered a few seconds after the player joins.
