> For the complete documentation index, see [llms.txt](https://jota-dev-documentation.gitbook.io/jota-dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jota-dev-documentation.gitbook.io/jota-dev/scripts/welcomecar.md).

# 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 %}
