# Setup

Before starting, you'll need to create the item that you've inserted in your `config.lua` file in your inventory system.\
We currently support **5 different inventories** thanks to [alp1x](https://github.com/alp1x)'s [bridge](https://github.com/alp1x/um-idcard/main/bridge)!

## 🧨 ESX

Setup on **es\_extended** is really easy!\
Go into your **esx\_multicharacter** server-side file `esx_multicharacter\server\main.lua` and replace lines 228 to line 232 with this:

```lua
-- esx_multicharacter line 228
AddEventHandler("esx_identity:completedRegistration", function(source, data)
    TriggerEvent("esx:onPlayerJoined", source, PREFIX .. awaitingRegistration[source], data)
    awaitingRegistration[source] = nil
    ESX.Players[GetIdentifier(source)] = true
    exports['five-idcard']:CreateMetaLicense(source)
end)
```

It will automatically give the **identity card** when the user has just registered.

## 🧧 QBCore

Go into your **qb-multicharacter** server-side file `qb-multicharacter/server/main.lua` and replace `GiveStarterItems` function with this:

```lua
-- qb-multicharacter line 6
local function GiveStarterItems(source)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)

    for _, v in pairs(QBCore.Shared.StarterItems) do
        Player.Functions.AddItem(v.item, v.amount, false, info)
    end
    return exports['five-idcard']:CreateMetaLicense(source)
end
```

It will automatically give the **identity card** when the user has just registered. You'll also have to remove **id\_card** from the **StarterItems** in your `qb-core/shared/main.lua` config.

### ✨ Extra

If you want to give yourself the **id card**, you can add this command to the `server.lua` of **five-idcard:**

```lua
QBCore.Commands.Add('givedocs', "Give yourself documents", {}, false, function(source)
    exports["five-idcard"]:CreateMetaLicense(source)
end, 'admin')
```

## ❓ Need support?

You still don't know how to proceed? \
We know this is not **beginner-friendly**, so we will give you **free** setup support on our [Discord Server](https://discord.gg/547nKvQhZ7)!


---

# 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://five-developments.gitbook.io/scripts/scripts/five-idcard/setup.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.
