# Jota Dev Welcome Car

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

How to start the script for its correct operation:

**Put in your server.cfg**

```markdown
# JotaDev WelcomeCar
ensure jc_coche_bienvenida
```

**Insert SQL into your database and configure your framework:**

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

```sql
CREATE TABLE IF NOT EXISTS welcome_cars (
    identifier VARCHAR(50) PRIMARY KEY,
    claimed BOOLEAN DEFAULT FALSE
);
```

{% endtab %}

{% tab title="ESX" %}

```lua
Config = {}

Config.Framework = 'esx' -- Ingrese "esx" para ESX o "qb" para QbCore

Config.NPC = {
    model = "mp_m_waremech_01",
    coords = vector3(225.51771, -857.096, 30.106513),
    heading = 157.94825
}

Config.SpawnCar = {
    coords = vector3(229.79135, -852.1683, 29.951473),
    heading = 245.43571
}

Config.Garages = 'default' -- 'default' o 'editable', en caso de que quieres editar, Editable/Server/SMain.lua

Config.MoledoCoche = 'comet6'

Config.VehicleInfo = {
    nombre = "Comet 6 Estilo y Potencia",
    descripcion = "El gobierno decide aportar un vehiculo para comenzar su vida en la ciudad.",
    imagen = "https://i.fmfile.com/2tAOsptSJW1WZ3XCzhHdQ/welcome_car_comet.png",
    prestaciones = {
        velocidad = "240 km/h",
        aceleracion = "Media",
        consumo = "Bajo"
    },
    nombre_server = {
        nombre = "Jota Dev Roleplay",
        informacion = "Prepárate para la mejor inmersión en la ciudad"
    }
}

Config.DiscordWebhook = '' -- Insete tu discord Webhook

```

{% endtab %}

{% tab title="QB-Core" %}

```lua
Config = {}

Config.Framework = 'qb' -- Ingrese "esx" para ESX o "qb" para QbCore

Config.NPC = {
    model = "mp_m_waremech_01",
    coords = vector3(225.51771, -857.096, 30.106513),
    heading = 157.94825
}

Config.SpawnCar = {
    coords = vector3(229.79135, -852.1683, 29.951473),
    heading = 245.43571
}

Config.Garages = 'default' -- 'default' o 'editable', en caso de que quieres editar, Editable/Server/SMain.lua

Config.MoledoCoche = 'comet6'

Config.VehicleInfo = {
    nombre = "Comet 6 Estilo y Potencia",
    descripcion = "El gobierno decide aportar un vehiculo para comenzar su vida en la ciudad.",
    imagen = "https://i.fmfile.com/2tAOsptSJW1WZ3XCzhHdQ/welcome_car_comet.png",
    prestaciones = {
        velocidad = "240 km/h",
        aceleracion = "Media",
        consumo = "Bajo"
    },
    nombre_server = {
        nombre = "Jota Dev Roleplay",
        informacion = "Prepárate para la mejor inmersión en la ciudad"
    }
}

Config.DiscordWebhook = '' -- Insete tu discord Webhook

```

{% endtab %}
{% endtabs %}

***

**If you use an external garage, edit it in jc\_coche\_bienvenida/Editable/Server/SMain.lua**

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

```lua
Config.Garages = 'editable' -- 'default' o 'editable', en caso de que quieres editar, Editable/Server/SMain.lua
```

{% endtab %}

{% tab title="SMain" %}

```lua
function InsertVehicleToGarage(identifier, model, plate, defaultMods, framework)
    -- EJEMPLO OKOKGARAJE
    local vehicleData = json.encode(defaultMods)
    local sharedWith = json.encode({})
    
    local query = [[
        INSERT INTO owned_vehicles (
            owner, plate, vehicle, `stored`, type, parking, doorcondition, windowcondition, tyrecondition,
            favourite, impoundTime, location, reason, sharedwith, vehiclename
        ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
    ]]

    MySQL.insert(query, {
        identifier,
        plate,
        vehicleData,
        0,    
        'car',
        'public',
        nil, nil, nil,
        0,
        nil, nil, nil,
        sharedWith,
        model
    }, function(id)
        print("ID:", id)
    end)
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/welcomecar.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.
