# Installation

## Installation

### Step 1: Download

Download the `elenamdtv1` folder and place it in your server's `resources` directory.

***

### Step 2: Database Setup

Run the following SQL in your database (HeidiSQL / phpMyAdmin):

```sql
CREATE TABLE IF NOT EXISTS `elenamdtv1_reports` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `officer` VARCHAR(255) NOT NULL,
  `suspect` VARCHAR(255) NOT NULL,
  `fine` INT DEFAULT 0,
  `jail` INT DEFAULT 0,
  `description` LONGTEXT,
  `date` VARCHAR(50) NOT NULL,
  `target_id` INT DEFAULT NULL,
  `charges` TEXT DEFAULT NULL,
  `evidence` TEXT DEFAULT NULL,
  `discount` INT DEFAULT 0,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS `elenamdtv1_warrants` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `suspect` VARCHAR(255) NOT NULL,
  `officer` VARCHAR(255) NOT NULL,
  `image` LONGTEXT,
  `description` LONGTEXT NOT NULL,
  `date` VARCHAR(50) NOT NULL,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS `elenamdtv1_chat_history` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `name` VARCHAR(255) NOT NULL,
  `text` LONGTEXT NOT NULL,
  `time` VARCHAR(50) NOT NULL,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS `elenamdtv1_vehicle_records` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `plate` VARCHAR(50) NOT NULL,
  `officer` VARCHAR(255) NOT NULL,
  `fine` INT DEFAULT 0,
  `jail` INT DEFAULT 0,
  `charges` TEXT DEFAULT NULL,
  `description` TEXT DEFAULT NULL,
  `date` VARCHAR(50) NOT NULL,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
```

### Step 3: server.cfg

Add the following to your `server.cfg`:

```
ensure oxmysql
ensure elenamdtv1
```

**Important:** `oxmysql` must start before `elenamdtv1`.

### Step 4: Configure

Open `config.lua` and adjust settings to your server. See the Configuration page for details.

### Step 5: Restart

Restart your server or run:

```
ensure elenamdtv1
```


---

# Agent Instructions: 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://elena-scripts.gitbook.io/elenascripts/core-systems/mdt-v2.0/installation.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.
