> For the complete documentation index, see [llms.txt](https://docs.cuxial.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cuxial.com/scripts/jobs/cuxial-electrician/configuration.md).

# Configuration

Every option of Cuxial Electrician explained: config, regions, rewards, trucks and daily tasks.

Behaviour lives in `shared/config.lua`; regions, levels, daily tasks, trucks and clothes live in the files of the `data` folder. Restart the resource after any change.

## General

| Option            | Type                | Default                        | What it does                                                                                                             |
| ----------------- | ------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| `debug`           | boolean             | `false`                        | Prints traces to the console. Also enabled by setting the convar `cuxial_electrician_debug` to `1`.                      |
| `account`         | string              | `'bank'`                       | Account that receives the job payment and the daily task rewards.                                                        |
| `job`             | string \| string\[] | `'all'`                        | Who can do the job. `'all'` = everyone. A job name or a list of job names (`{ 'electrician' }`) limits it to those jobs. |
| `logs.convar`     | string              | `'cuxial_electrician_webhook'` | Name of the convar that holds the Discord webhook. With the convar empty, no logs are sent.                              |
| `admin.auditDays` | number              | `60`                           | Days the audit rows of this job are kept in `cuxial_jobs_audit`. Older rows are deleted once a day. Minimum 1.           |

## Interface · `ui`

| Option            | Type         | Default      | What it does                                                                                           |
| ----------------- | ------------ | ------------ | ------------------------------------------------------------------------------------------------------ |
| `accent`          | string (hex) | configurable | Accent colour of the panel.                                                                            |
| `currency.symbol` | string       | `'$'`        | Currency symbol shown next to amounts.                                                                 |
| `currency.locale` | string       | `'en-US'`    | Number format of the amounts (thousands and decimal separators). Use `'es-ES'` for the Spanish format. |

## Job NPC · `npc`

| Option                                      | Type    | Default                | What it does                                                                                  |
| ------------------------------------------- | ------- | ---------------------- | --------------------------------------------------------------------------------------------- |
| `coords`                                    | vector4 | example position       | Position and heading of the NPC that opens the panel. Change it to place the job on your map. |
| `model`                                     | string  | `'s_m_y_construct_01'` | Ped model of the NPC.                                                                         |
| `distance`                                  | number  | `2.0`                  | Metres at which the interaction on the NPC is offered.                                        |
| `menuDistance`                              | number  | `6.0`                  | Metres beyond which the server refuses to open the panel.                                     |
| `spawnDistance`                             | number  | `60.0`                 | Metres within which the NPC exists for a player.                                              |
| `blip.enabled`                              | boolean | `true`                 | `true` shows the job blip on the map. `false` hides it.                                       |
| `blip.sprite` / `blip.color` / `blip.scale` | number  | `643` / `3` / `0.9`    | Look of the job blip.                                                                         |

{% hint style="warning" %}
The truck spawn points and the drop-off are not part of `npc`. If you move the NPC, move `spawns` and `deliver` in `data/regions.lua` as well.
{% endhint %}

## Interaction and markers · `target`

| Option         | Type   | Default  | What it does                                                                                            |
| -------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------- |
| `distance`     | number | `2.0`    | Metres at which the repair option of a point is offered.                                                |
| `showDistance` | number | `25.0`   | Metres at which a marker is drawn over the pending points. `0` = no marker.                             |
| `buildOffset`  | number | `0.9`    | Metres the "build platform" option is moved away from the pole, towards the player.                     |
| `signalOffset` | number | `0.6`    | Metres the repair option of a traffic light is moved away from its post, towards the player.            |
| `marker`       | table  | see file | Marker over the pending points: `type`, `scale`, `height`, `color` (`{ r, g, b, a }`), `bob`, `rotate`. |
| `ring`         | table  | see file | Ring drawn on the ground under street lamps and poles: `type`, `scale`, `color`.                        |
| `icons`        | table  | see file | Font Awesome icon of each interaction option.                                                           |

## Blips · `blips`

| Option       | Type   | Default                                    | What it does                                                                                 |
| ------------ | ------ | ------------------------------------------ | -------------------------------------------------------------------------------------------- |
| `task`       | table  | `{ sprite = 354, color = 5, scale = 0.8 }` | Blip of each pending repair.                                                                 |
| `truck`      | table  | `{ sprite = 67, color = 0, scale = 0.8 }`  | Blip of each service truck.                                                                  |
| `deliver`    | table  | `{ sprite = 38, color = 29, scale = 0.8 }` | Blip of the drop-off.                                                                        |
| `routeColor` | number | `38`                                       | Colour of the GPS route.                                                                     |
| `routeMs`    | number | `5000`                                     | Milliseconds between recalculations of the route to the nearest pending point. Minimum 1000. |

## Effects · `fx` and `signals`

| Option                  | Type   | Default                             | What it does                                                                                      |
| ----------------------- | ------ | ----------------------------------- | ------------------------------------------------------------------------------------------------- |
| `fx.asset` / `fx.name`  | string | `'core'` / `'ent_dst_elec_fire_sp'` | Particle effect played on the pending points.                                                     |
| `fx.distance`           | number | `30.0`                              | Metres at which the sparks are shown.                                                             |
| `fx.repeatMs`           | number | `3000`                              | Milliseconds between two plays of the effect.                                                     |
| `signals.distance`      | number | `150.0`                             | Metres from a pending junction at which its traffic lights start to flicker.                      |
| `signals.tickMs`        | number | `250`                               | Milliseconds between flicker steps. Minimum 50.                                                   |
| `signals.fixedDistance` | number | `1.5`                               | Metres around a repaired point within which a traffic light counts as fixed and stops flickering. |

## Crew · `crew`

| Option             | Type    | Default | What it does                                                                                                    |
| ------------------ | ------- | ------- | --------------------------------------------------------------------------------------------------------------- |
| `maxPlayers`       | number  | `4`     | Maximum members of a crew, owner included.                                                                      |
| `inviteDistance`   | number  | `8.0`   | Maximum metres between the owner and the invited player.                                                        |
| `inviteSeconds`    | number  | `60`    | Seconds until an invite expires. Minimum 5.                                                                     |
| `reconnectSeconds` | number  | `180`   | Seconds a member who disconnects during a job keeps their seat.                                                 |
| `splitRewards`     | boolean | `true`  | `true` lets the owner split the money by percentage. `false` removes the option and everyone receives the same. |

## Job rules · `run`

| Option             | Type    | Default | What it does                                                                                       |
| ------------------ | ------- | ------- | -------------------------------------------------------------------------------------------------- |
| `cooldownHours`    | number  | `0`     | Hours each player must wait between jobs. `0` = no cooldown.                                       |
| `exclusiveRegions` | boolean | `true`  | `true` allows a single crew per region at a time. `false` lets several crews work the same region. |
| `spawnFreeRadius`  | number  | `6.0`   | Metres that must be free of vehicles around each truck spawn point.                                |

## Service trucks · `trucks`

| Option           | Type    | Default   | What it does                                                                                            |
| ---------------- | ------- | --------- | ------------------------------------------------------------------------------------------------------- |
| `plate`          | string  | `'ELEC'`  | Plate prefix, up to 4 characters. The script completes it with the job number and the truck number.     |
| `fuel`           | number  | `100.0`   | Fuel the trucks start with, written to the `fuel` state of the vehicle.                                 |
| `keys`           | boolean | `true`    | `true` gives the keys through `cuxial_garages` when that resource is running. `false` never gives keys. |
| `secondFrom`     | number  | `3`       | Crew size from which a second truck is delivered.                                                       |
| `spawnTimeoutMs` | number  | `5000`    | Milliseconds the server waits for each truck to be created.                                             |
| `minEngine`      | number  | `-3900.0` | Engine health below which a truck counts as destroyed.                                                  |

The truck models and their extras are set in `data/trucks.lua`.

## Repairs · `repair`

| Option         | Type   | Default                  | What it does                                                                                                                         |
| -------------- | ------ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| `maxDistance`  | number | `2.5`                    | Maximum metres between the player and the point for transformers, panels and traffic lights.                                         |
| `signalSlack`  | number | `0.6`                    | Extra horizontal metres allowed on traffic lights.                                                                                   |
| `signalHeight` | number | `4.0`                    | Height difference in metres allowed on traffic lights.                                                                               |
| `highDistance` | number | `4.5`                    | Maximum horizontal metres between the player and the point on street lamps and poles.                                                |
| `highHeight`   | number | `2.0`                    | Height difference in metres allowed between the platform and the fault.                                                              |
| `marginMs`     | number | `500`                    | Tolerance in milliseconds on the minimum time of each minigame (`data/games.lua`).                                                   |
| `lockSeconds`  | number | `120`                    | Seconds a point stays reserved for the player repairing it. Minimum 10.                                                              |
| `fail`         | string | `'damage'`               | What happens when a minigame is failed. `'damage'` = shock animation and health loss, `'anim'` = animation only, `'none'` = nothing. |
| `failDamage`   | table  | `{ min = 10, max = 25 }` | Health lost on a failure, picked at random in this range. Only with `fail = 'damage'`.                                               |

{% hint style="info" %}
The distance options are checked by the server. Raise them a little if players with high latency see repairs rejected as "too far"; do not lower them below the interaction distance in `target.distance`.
{% endhint %}

## Ladders and platforms · `rigs`

| Option                 | Type   | Default         | What it does                                                                                                                              |
| ---------------------- | ------ | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `lampRig`              | string | `'ladder'`      | How street lamps are reached. `'ladder'` = ladder taken from the truck, `'lift'` = lifting platform, `'none'` = repaired from the ground. |
| `poleRig`              | string | `'lift'`        | How utility poles are reached. Same values.                                                                                               |
| `spacing`              | number | `20.0`          | Minimum metres between a platform and any other platform or ladder.                                                                       |
| `buildDistance`        | number | `3.0`           | Maximum metres from the player to the point to build, and to the foot to remove.                                                          |
| `serveDistance`        | number | `3.0`           | Maximum metres between the platform or ladder and the point for it to count.                                                              |
| `riderSlack`           | number | `5.0`           | Tolerance in metres on the position of a player standing on the ladder.                                                                   |
| `insideSlack`          | number | `0.5`           | Tolerance in metres when checking who is inside the basket.                                                                               |
| `buildMs` / `removeMs` | number | `2500` / `2500` | Duration of the build and remove progress bars.                                                                                           |
| `ladderMs`             | number | `1500`          | Duration of the take, place, collect and return ladder bars.                                                                              |
| `viewDistance`         | number | `75.0`          | Metres within which the platform and ladder props exist for a player.                                                                     |

With `'ladder'` the flow is: take the ladder from the truck, place it, climb, repair, climb down, collect it and return it to the truck. With `'lift'` the truck must be parked at the distance set in `data/rigs.lua` (5 to 9 metres by default) before the platform can be built.

## Drop-off · `deliver`

| Option       | Type    | Default | What it does                                                                                                                                  |
| ------------ | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `radius`     | number  | `20.0`  | Metres around the drop-off point of the region within which the trucks must be.                                                               |
| `requireAll` | boolean | `true`  | `true` requires every truck to be intact. `false` only requires the main truck; the others, if they still exist, must be at the drop-off too. |

The job is paid when a crew member presses the interaction key at the wheel of one of the trucks, with every ladder returned.

## Payment · `reward`

| Option           | Type   | Default  | What it does                                                                                                                    |
| ---------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `mode`           | string | `'team'` | How the region reward is paid. See below.                                                                                       |
| `teamMultiplier` | number | `0.64`   | Multiplier applied to the region reward when the crew has more than one member. Used by `'team'` and `'split'`.                 |
| `items`          | table  | `{}`     | Items given to each member on payment: `{ item = 'name', count = 1, chance = 50 }`. `chance` is a percentage. Empty = no items. |

| `mode`    | Solo        | Crew of two or more                               |
| --------- | ----------- | ------------------------------------------------- |
| `'team'`  | Full reward | Each member receives reward × `teamMultiplier`    |
| `'flat'`  | Full reward | Each member receives the full reward              |
| `'split'` | Full reward | Reward × `teamMultiplier`, divided among the crew |

Every member receives the full XP of the region in all modes. Members who are disconnected at the drop-off receive nothing.

{% hint style="info" %}
Items are only given when they exist in your inventory and the player can carry them. A missing item is reported in the server console when the resource starts.
{% endhint %}

## Clothes · `outfit`

| Option | Type   | Default  | What it does                                                                                                                                      |
| ------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mode` | string | `'none'` | Clothes worn during the job. `'workwear'` and `'classic'` are the two sets defined in `data/outfits.lua`; `'none'` leaves the player as they are. |

The clothes only apply to the freemode male and female models. The player gets their own clothes back when the job ends.

## Profile, ranking and screens

| Option                     | Type   | Default | What it does                                                                                           |
| -------------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------ |
| `leaderboard.size`         | number | `10`    | Entries of each ranking list. From 1 to 50.                                                            |
| `leaderboard.cacheSeconds` | number | `60`    | Seconds the ranking is cached before it is read from the database again.                               |
| `history.size`             | number | `10`    | Jobs shown in the history of each player. From 1 to 50.                                                |
| `profile.flushMs`          | number | `30000` | Milliseconds between deferred saves of XP and daily tasks. Minimum 5000. Money is always paid at once. |
| `tips.seconds`             | number | `12`    | Seconds a first-time tip stays on screen. Minimum 3.                                                   |
| `finish.seconds`           | number | `15`    | Seconds the final summary stays on screen. Minimum 3.                                                  |

## Commands and keys

| Option                     | Type              | Default                                                      | What it does                                                                 |
| -------------------------- | ----------------- | ------------------------------------------------------------ | ---------------------------------------------------------------------------- |
| `commands.<id>.name`       | string \| `false` | see [Commands](/scripts/jobs/cuxial-electrician/commands.md) | Name of the command. `false` disables it.                                    |
| `commands.<id>.restricted` | string            | `'group.admin'`                                              | Group allowed to use a staff command.                                        |
| `keys`                     | table             | see [Commands](/scripts/jobs/cuxial-electrician/commands.md) | Default key of each action. Players can rebind them in the GTA key settings. |

## Data files

The files in `data` are meant to be edited. The values they ship with are examples: change them to fit your map and your economy.

| File               | What it holds                                                                                     |
| ------------------ | ------------------------------------------------------------------------------------------------- |
| `data/regions.lua` | Regions: `id`, `label`, `minLevel`, `reward` (`money`, `xp`), `tasks`, `spawns` and `deliver`.    |
| `data/points.lua`  | Coordinates of every repair point per region, and the traffic light models that flicker.          |
| `data/levels.lua`  | XP needed to go from each level to the next. The maximum level is the number of entries plus one. |
| `data/daily.lua`   | Daily tasks and the hours between resets.                                                         |
| `data/trucks.lua`  | Truck models and vehicle extras.                                                                  |
| `data/rigs.lua`    | Models and measurements of the platform and the ladder.                                           |
| `data/outfits.lua` | Clothing sets per mode and sex.                                                                   |
| `data/games.lua`   | Minigame of each kind of point and its parameters.                                                |
| `data/guide.lua`   | Cards of the guide tab.                                                                           |

### Regions

| Field      | What it does                                                                                                                                                                                                                 |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`       | Stable number of the region. The database stores it; do not reuse or renumber it.                                                                                                                                            |
| `label`    | Locale key with the name of the region.                                                                                                                                                                                      |
| `minLevel` | Level every member of the crew needs.                                                                                                                                                                                        |
| `reward`   | `{ money, xp }` per member, before `reward.mode` is applied.                                                                                                                                                                 |
| `tasks`    | Amount of each kind of repair, picked at random between `min` and `max` and capped by the points available. Kinds: `trafo`, `panel`, `lamp`, `junction`, `pole`. A `junction` brings its transformer and its traffic lights. |
| `spawns`   | Spawn points of the trucks (`vec4`), in order. The server uses the first free ones.                                                                                                                                          |
| `deliver`  | Drop-off point of the trucks (`vec3`).                                                                                                                                                                                       |

### Daily tasks

Each entry of `data/daily.lua` has an `id`, a `label`, a `kind`, a `goal` and the `xp` and `money` paid on completion. `resetHours` is the number of hours between resets, counted from each player's last reset.

| `kind`      | Counts                                  |
| ----------- | --------------------------------------- |
| `'repairs'` | Repairs made by the player              |
| `'runs'`    | Jobs delivered                          |
| `'money'`   | Money earned on delivery                |
| `'team'`    | Jobs delivered in a crew of two or more |

## Common changes

### Limit the job to a profession

{% code title="shared/config.lua" %}

```lua
job = { 'electrician' },
```

{% endcode %}

### Use the platform on street lamps too

{% code title="shared/config.lua" %}

```lua
rigs = {
    lampRig = 'lift',
    poleRig = 'lift',
    -- ...
},
```

{% endcode %}

### Pay the full reward to every member

{% code title="shared/config.lua" %}

```lua
reward = { mode = 'flat', teamMultiplier = 0.64, items = {} },
```

{% endcode %}

### Give an item on payment

{% code title="shared/config.lua" %}

```lua
reward = {
    mode = 'team',
    teamMultiplier = 0.64,
    items = {
        { item = 'water', count = 1, chance = 50 },
    },
},
```

{% endcode %}

### Rename the texts

The names of the regions, the notifications and the interface texts are in `locales/en.json` and `locales/es.json`. Edit the value, never the key.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cuxial.com/scripts/jobs/cuxial-electrician/configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
