> For the complete documentation index, see [llms.txt](https://yevas-development.gitbook.io/yeva/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yevas-development.gitbook.io/yeva/paid-resources/distress-call/installation-and-config.md).

# Installation & Config

## Installation

1. Download the latest script on [keymaster.fivem](https://keymaster.fivem.net) & unzip <mark style="color:yellow;">**yeva\_distresscall**</mark>
2. Drag script into your resources folder, for example on `[qb]` or `[esx_addons]` folder.&#x20;
3. Don't forget to start the script in the `config.lua` if you put the script outside of that folder.
4. Import `sql.sql` to your database server.

## SQL File

```sql
CREATE TABLE `distress_calls` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `identifier` VARCHAR(255) NOT NULL,
    `flag` INT(11) NOT NULL DEFAULT '0',
    `victim` VARCHAR(255) NOT NULL,
    `message` VARCHAR(255) NOT NULL,
    `location` VARCHAR(255) NOT NULL,
    `distance` VARCHAR(255) NOT NULL DEFAULT '0',
    `time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
    PRIMARY KEY (`id`)
);
```

## Configuration

`config.lua`

```lua
config = {}

config.debug = false
config.framework = 'esx' -- esx or qb

config.distress = {
    job = 'ambulance',             -- Job allowed to access distress calls (ambulance)
    spam = true,                   -- Prevents spamming distress calls (false = no spam allowed)
    alertlimit = 10,               -- Maximum number of alerts that can be sent
    signallimit = 10,              -- Maximum number of signals that can be sent
    cooldown = 20000,              -- Cooldown time in milliseconds before sending another signal/alert
    autodelete = false,            -- Automatically delete calls after processing (false = no auto-delete)
    notifyaction = true            -- Enables notification for actions taken (true = enabled)
}

config.trigger = {
    command = true,                -- Allows command usage to open distress menu
    commandtext = 'distressmenu',  -- Command text to trigger the distress menu

    usekey = true,                 -- Allows using a key to trigger distress actions
    buttonkey = 'M',               -- The key used for triggering distress actions

    signalform = true,             -- Enables the use of a command to trigger a distress signal form
    signalcommand = '900',         -- Command to trigger the distress signal form

    testalert = true,              -- Enables test alert functionality
    cmdtestalert = 'testalert',    -- Command text to test sending an alert
    
    testsignal = true,             -- Enables test signal functionality
    cmdtestsignal = 'testsignal'   -- Command text to test sending a signal
}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yevas-development.gitbook.io/yeva/paid-resources/distress-call/installation-and-config.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
