# JotaDev Auctions

<figure><img src="/files/VgeBKo8y79zH2ZDuuMmg" alt=""><figcaption></figcaption></figure>

**Put in your server.cfg**

```markdown
# Jota Dev Auction and Raffle system
ensure jc_subastas
```

**Insert SQL into your database:**

{% tabs %}
{% tab title="SQL" %}

```sql
CREATE TABLE IF NOT EXISTS `subastas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `precio_inicial` int(11) NOT NULL,
  `incremento_minimo` int(11) NOT NULL,
  `duracion` int(11) NOT NULL,
  `estado` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'activa',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `tipo` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item',
  `imagen` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `puja` int(11) DEFAULT NULL,
  `modelo` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'NONE',
  `cantidad` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'NONE',
  `last_bid_license` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=72 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `sorteos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tipo` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `modelo` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cantidad` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'NONE',
  `duracion` int(11) NOT NULL,
  `imagen` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `estado` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'activo',
  `precio` int(11) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE IF NOT EXISTS sorteos_papeletas (
    id INT AUTO_INCREMENT PRIMARY KEY,
    sorteo_id INT NOT NULL,
    identifier VARCHAR(50) NOT NULL,
    fecha DATETIME DEFAULT CURRENT_TIMESTAMP
);

```

{% endtab %}
{% endtabs %}

**This is the script configuration, configure it to your liking**

{% tabs %}
{% tab title="Config" %}

```lua
Config = Config or {}
Config.Framework = "" -- qb, esx 

Config.AdminGroups = { 'admin', 'superadmin' }

Config.Language = '' -- es | en

Config.CommandOpenUIAdmin = 'adminsubastas'
Config.CommandOpenUISubastasSorteos = 'pujas'

Config.Debug = false

Config.CuentaSorteo = 'bank' -- Opciones: 'money' o'cash', 'bank', 'black_money'

Config.NPC = {
    model = "a_m_y_business_01",
    coords = vector3(-364.319, -249.206, 36.080),
    heading = 48.0,
    blip = {
        enabled = true,
        sprite = 605,
        color = 2,
        scale = 0.8,
        label = "Subastas y Sorteos"
    },
    command = "pujas"
}

Config.WebhookSubastas = ''
Config.WebhookSorteos = ''
Config.WebhookGanadores = ''

if Config.Framework == 'qb' then
    QBCore = exports['qb-core']:GetCoreObject()
elseif Config.Framework == 'esx' then
    ESX = exports["es_extended"]:getSharedObject()
else
    print '^1[^6jc_subastas^1] ^2Framework No encontrada, ingrese esx o qb^0'
    return
end

```

{% endtab %}
{% endtabs %}


---

# 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://jota-dev-documentation.gitbook.io/jota-dev/scripts/auction.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.
