> For the complete documentation index, see [llms.txt](https://zynoxdev.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zynoxdev.gitbook.io/docs/zynox-resources/zx_tsunami/configuration.md).

# Configuration

Exhaustive setting-by-setting reference for `config.lua`

***

## 📑 Table of Contents

1. [General Server Settings](#1-general-server-settings)
2. [AI Voice & Speech Synthesis](#2-ai-voice--speech-synthesis)
3. [Audio & Volume Levels](#3-audio--volume-levels)
4. [Power Grid & Blackout Effects](#4-power-grid--blackout-effects)
5. [Vehicle Headlight Multiplier](#5-vehicle-headlight-multiplier)
6. [Weather Transitions](#6-weather-transitions)
7. [Emergency Speech Text & Chat Alert](#7-emergency-speech-text--chat-alert)
8. ["All-Clear" / Restart Cancellation Settings](#8-all-clear--restart-cancellation-settings)
9. [Admin Command & Permissions](#9-admin-command--permissions)
10. [Complete Default Configuration](#10-complete-default-configuration)

***

## 1. General Server Settings

```lua
Config.ServerName = "Moon City"
Config.WarningTimes = { 15, 10, 5, 2, 1 }
```

### `Config.ServerName`

* **Type**: `string`
* **Default**: `"Moon City"`
* **Description**: The name of your server. This is spoken dynamically by the AI voice and inserted into the chat announcement wherever `{servername}` is referenced.

### `Config.WarningTimes`

* **Type**: `table` (Array of numbers)
* **Default**: `{ 15, 10, 5, 2, 1 }`
* **Description**: The countdown intervals (in remaining minutes) at which the warning triggers when a txAdmin scheduled restart is running.

***

## 2. AI Voice & Speech Synthesis

The script utilizes the client's Chromium Embedded Framework (CEF) **Web Speech API** (`window.speechSynthesis`). It is 100% free, fast, and requires no external API keys.

```lua
Config.VoiceType = "female"
Config.SpeechLanguage = "en-US"
Config.FemaleSpeechPitch = 1.12
Config.MaleSpeechPitch = 1.02
Config.SpeechRate = 0.90
```

### `Config.VoiceType`

* **Type**: `string`
* **Options**: `"female"` or `"male"`
* **Default**: `"female"`
* **Description**: Selects the dispatcher vocal persona. Both personas are pre-tuned with custom pitches and rates to sound pleasant, natural, and crisp.

### `Config.SpeechLanguage`

* **Type**: `string` (BCP-47 Language Tag)
* **Default**: `"en-US"`
* **Options**: `"en-US"`, `"en-GB"`, `"en-AU"`, etc.
* **Description**: Sets the accent and locale for the speech synthesis engine.

### `Config.FemaleSpeechPitch` & `Config.MaleSpeechPitch`

* **Type**: `number`
* **Default**: `1.12` (Female) / `1.02` (Male)
* **Range**: `0.5` to `2.0`
* **Description**: Modulates voice pitch. Higher values create a sweeter/lighter tone; lower values produce a deeper authority dispatcher voice.

### `Config.SpeechRate`

* **Type**: `number`
* **Default**: `0.90`
* **Range**: `0.5` to `1.5`
* **Description**: Speaking pace. `0.90` is calibrated for clear emergency cadence over background sirens.

***

## 3. Audio & Volume Levels

Controls the volume levels of the embedded audio elements and siren phase durations.

```lua
Config.Warning1Volume = 0.5
Config.Warning2Volume = 0.5
Config.BackgroundMusicVolume = 0.35
Config.Warning1Duration = 8.5
```

### `Config.Warning1Volume`

* **Type**: `number` | **Range**: `0.0` (Mute) to `1.0` (Max) | **Default**: `0.5`
* **Description**: Volume of the initial emergency siren (`html/audio/warning1.ogg`).

### `Config.Warning2Volume`

* **Type**: `number` | **Range**: `0.0` to `1.0` | **Default**: `0.5`
* **Description**: Volume of the final concluding siren (`html/audio/warning2.ogg`).

### `Config.BackgroundMusicVolume`

* **Type**: `number` | **Range**: `0.0` to `1.0` | **Default**: `0.35`
* **Description**: Volume of ambient tension music (`html/audio/bg-voice.ogg`) playing under the voice announcement.

### `Config.Warning1Duration`

* **Type**: `number` (Seconds) | **Default**: `8.5`
* **Description**: Duration to play Siren 1 before speech synthesis begins.

***

## 4. Power Grid & Blackout Effects

Controls the realistic electrical blackout sequence.

```lua
Config.EnablePowerFlicker = true
Config.EffectsDuration = 50
```

### `Config.EnablePowerFlicker`

* **Type**: `boolean` | **Default**: `true`
* **Description**: When enabled, the city power grid surges with rapid flickers, voltage sags, and dark blackouts.

### `Config.EffectsDuration`

* **Type**: `number` (Seconds) | **Default**: `50`
* **Description**: How long the power grid surge and blackout effect lasts before stabilizing.

***

## 5. Vehicle Headlight Multiplier

```lua
Config.BoostVehicleLights = true
Config.VehicleLightMultiplier = 1.6
```

### `Config.BoostVehicleLights`

* **Type**: `boolean` | **Default**: `true`
* **Description**: When enabled, boosts headlight luminosity on player vehicles during blackout sequences.

### `Config.VehicleLightMultiplier`

* **Type**: `number` | **Default**: `1.6`
* **Description**: Luminosity multiplier applied via `SetVehicleLightMultiplier()`.

***

## 6. Weather Transitions

```lua
Config.EnableWeatherTransition = true
Config.DisasterWeather = "THUNDER"
Config.NormalWeather = "CLEAR"
Config.DisasterWeatherTransition = 8.0
Config.NormalWeatherTransition = 25.0
```

### `Config.EnableWeatherTransition`

* **Type**: `boolean` | **Default**: `true`
* **Description**: Smoothly fades GTA V weather into storm weather during warning alerts.

### `Config.DisasterWeather`

* **Type**: `string` | **Default**: `"THUNDER"`
* **Options**: `"THUNDER"`, `"RAIN"`, `"FOGGY"`, `"CLEAR"`, etc.

### `Config.DisasterWeatherTransition`

* **Type**: `number` (Seconds) | **Default**: `8.0`
* **Description**: Duration in seconds to cross-fade into disaster weather.

***

## 7. Emergency Speech Text & Chat Alert

```lua
Config.SpeechText = "Attention citizens. This is an urgent announcement for {servername}. A tsunami alert is in effect, and the server will restart in {minutes} {minute_word}. Please head to safe areas or higher ground right now. Thank you for your cooperation."

Config.EnableChatNotification = true
Config.ChatPrefix = "EMERGENCY"
Config.ChatPrefixColor = { 255, 50, 50 }
Config.ChatMessage = "🚨 Tsunami Warning! Server is restarting in %s %s!"
```

### Placeholders Available:

* `{servername}`: Replaced by `Config.ServerName`.
* `{minutes}`: Replaced by countdown minutes (e.g., `5`).
* `{minute_word}`: Pluralized word (`"minute"` or `"minutes"`).

***

## 8. "All-Clear" / Restart Cancellation Settings

```lua
Config.EnableCancelledAnnouncement = true
Config.CancelAfterWarning = true
Config.CancelledChatPrefix = "ALL CLEAR"
Config.CancelledChatColor = { 50, 220, 50 }
Config.CancelledChatMessage = "✅ Tsunami Threat Passed! The disaster warning has been officially lifted. All citizens may safely exit shelters."
Config.CancelledSpeechText = "Attention everyone, we have wonderful news! The tsunami threat for {servername} has safely passed. The warning is officially lifted, and it is now completely safe to exit your shelters. Have a great time!"
Config.CancelledSpeechPitch = 1.14
Config.CancelledSpeechRate = 0.92
```

***

## 9. Admin Command & Permissions

```lua
Config.TestCommand = "testrestart"
Config.TestAcePermission = "command"
```

***

## 10. Complete Default Configuration

```lua
Config = {}

Config.ServerName = "Moon City"
Config.WarningTimes = { 15, 10, 5, 2, 1 }

Config.VoiceType = "female"          
Config.SpeechLanguage = "en-US"    

Config.FemaleSpeechPitch = 1.12    
Config.MaleSpeechPitch = 1.02      
Config.SpeechRate = 0.90           

Config.Warning1Volume = 0.5
Config.Warning2Volume = 0.5
Config.BackgroundMusicVolume = 0.35
Config.Warning1Duration = 8.5

Config.EnablePowerFlicker = true
Config.EffectsDuration = 50

Config.BoostVehicleLights = true
Config.VehicleLightMultiplier = 1.6

Config.EnableWeatherTransition = true
Config.DisasterWeather = "THUNDER"
Config.NormalWeather = "CLEAR"
Config.DisasterWeatherTransition = 8.0
Config.NormalWeatherTransition = 25.0

Config.SpeechText = "Attention citizens. This is an urgent announcement for {servername}. A tsunami alert is in effect, and the server will restart in {minutes} {minute_word}. Please head to safe areas or higher ground right now. Thank you for your cooperation."

Config.EnableChatNotification = true
Config.ChatPrefix = "EMERGENCY"
Config.ChatPrefixColor = { 255, 50, 50 }
Config.ChatMessage = "🚨 Tsunami Warning! Server is restarting in %s %s!"

Config.EnableCancelledAnnouncement = true
Config.CancelAfterWarning = true
Config.CancelledChatPrefix = "ALL CLEAR"
Config.CancelledChatColor = { 50, 220, 50 }
Config.CancelledChatMessage = "✅ Tsunami Threat Passed! The disaster warning has been officially lifted. All citizens may safely exit shelters."
Config.CancelledSpeechText = "Attention everyone, we have wonderful news! The tsunami threat for {servername} has safely passed. The warning is officially lifted, and it is now completely safe to exit your shelters. Have a great time!"
Config.CancelledSpeechPitch = 1.14
Config.CancelledSpeechRate = 0.92

Config.TestCommand = "testrestart"
Config.TestAcePermission = "command"
```


---

# 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://zynoxdev.gitbook.io/docs/zynox-resources/zx_tsunami/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.
