> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fenixstudios.net/llms.txt
> Use this file to discover all available pages before exploring further.

# FNX IDCARD

<Frame>
  <img src="https://mintcdn.com/fenixstudios/J7JIkRWEOc9_uF5R/images/image-17.png?fit=max&auto=format&n=J7JIkRWEOc9_uF5R&q=85&s=ea2a3640b3f94adfab2ec6a8fbdc5126" alt="Image" width="570" height="321" data-path="images/image-17.png" />
</Frame>

## Image Upload Setup

To enable **document photos**, you must configure an uploader in:

`imageuploader.lua`

### Discord

Set the system to:

```text theme={null}
discord
```

Then add your **Discord webhook**.

> Discord may delete uploaded images after **1–2 days**.

### FiveManage

Set the system to:

```text theme={null}
fivemanage
```

Then add your **API token**.

### Custom Upload System

You can also implement a **custom uploader**. An example is included in the file.

![Image uploader setup](https://807306352-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYyUqsAFg0fc2f2rIKA9A%2Fuploads%2FyXro6sIYidKBvc27RbMJ%2Fimage.png?alt=media\&token=9d821422-4f0f-435c-bd08-2bf39b31a88f)

***

# Using ox\_inventory

Add the following items to your **ox inventory items file**.

```lua theme={null}
['documents'] = {
    label = 'ID Card',
    weight = 0.03,
    stack = true,
    close = true,
},

['drive'] = {
    label = 'Drive License',
    weight = 0.03,
    stack = true,
    close = true,
},

['plane'] = {
    label = 'Drive License',
    weight = 0.03,
    stack = true,
    close = true,
},

['boat'] = {
    label = 'Drive License',
    weight = 0.03,
    stack = true,
    close = true,
},

['weapon'] = {
    label = "Weapon License",
    weight = 0.03,
    stack = true,
    close = true,
},

['cryptostick'] = {
    label = 'crypto stick',
    weight = 200,
    stack = true,
    close = true,
    description = "Why would someone ever buy money that doesn't exist.. How many would it contain..?"
},
```

***

# Using qs / qb / lj inventory

Add these items to your **items.lua**.

```lua theme={null}
["documents"] = {
    ["name"] = "documents",
    ["label"] = "documents",
    ["weight"] = 1,
    ["type"] = "item",
    ["image"] = "id-card.png",
    ["unique"] = true,
    ["useable"] = true,
    ["shouldClose"] = true,
    ["combinable"] = nil,
    ["description"] = "Documenti."
},

["drive"] = {
    ["name"] = "drive",
    ["label"] = "drive",
    ["weight"] = 1,
    ["type"] = "item",
    ["image"] = "drive.png",
    ["unique"] = true,
    ["useable"] = true,
    ["shouldClose"] = true,
    ["combinable"] = nil,
    ["description"] = "Documenti."
},

["weapons"] = {
    ["name"] = "weapons",
    ["label"] = "weapons",
    ["weight"] = 1,
    ["type"] = "item",
    ["image"] = "weapons.png",
    ["unique"] = true,
    ["useable"] = true,
    ["shouldClose"] = true,
    ["description"] = "Weapon License"
},

["cryptostick"] = {
    ["name"] = "cryptostick",
    ["label"] = "cryptostick",
    ["weight"] = 1,
    ["type"] = "item",
    ["image"] = "cryptostick.png",
    ["unique"] = false,
    ["useable"] = true,
    ["shouldClose"] = true,
    ["description"] = "Special item."
},
```

***

# Using core-inventory

Run this SQL inside your **database**.

```sql theme={null}
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`, `x`, `y`, `category`, `componentTint`, `componentHash`, `backpackModel`, `backgroundTexture`, `description`) VALUES ('documents', 'documents', 4, 0, 1, 1, 1, 'documents', NULL, NULL, NULL, NULL, 'An item');
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`, `x`, `y`, `category`, `componentTint`, `componentHash`, `backpackModel`, `backgroundTexture`, `description`) VALUES ('drive', 'drive', 4, 0, 1, 1, 1, 'documents', NULL, NULL, NULL, NULL, 'An item');
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`, `x`, `y`, `category`, `componentTint`, `componentHash`, `backpackModel`, `backgroundTexture`, `description`) VALUES ('weapon', 'weapon', 4, 0, 1, 1, 1, 'documents', NULL, NULL, NULL, NULL, 'An item');
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`, `x`, `y`, `category`, `componentTint`, `componentHash`, `backpackModel`, `backgroundTexture`, `description`) VALUES ('cryptostick', 'cryptostick', 4, 0, 1, 1, 1, 'documents', NULL, NULL, NULL, NULL, 'An item');
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`, `x`, `y`, `category`, `componentTint`, `componentHash`, `backpackModel`, `backgroundTexture`, `description`) VALUES ('boat', 'boat', 4, 0, 1, 1, 1, 'documents', NULL, NULL, NULL, NULL, 'An item');
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`, `x`, `y`, `category`, `componentTint`, `componentHash`, `backpackModel`, `backgroundTexture`, `description`) VALUES ('plane', 'plane', 4, 0, 1, 1, 1, 'documents', NULL, NULL, NULL, NULL, 'An item');
```

Create this category inside **config.lua**

```lua theme={null}
["documents"] = {
    color = "#f2f2f2",
    takeSound = 'take',
    putSound = 'put',
    stack = 1
},
```

Update **CloseAfterUse**

```text theme={null}
"documents", "weapon", "drive", "plane", "boat"
```

***

# Date of Birth Error

If you encounter a **date of birth error**, check:

```text theme={null}
config.js
```

Make sure:

* date format is correct
* separator is correct

Example:

![dob error](https://807306352-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYyUqsAFg0fc2f2rIKA9A%2Fuploads%2FV1SFqbUYAp8FKZk5NgkT%2Fimage.png?alt=media\&token=d5a7fc36-c313-4430-8a5a-cf241add9727)

***

# Weapon License Menu

Open the weapon license menu:

```lua theme={null}
TriggerEvent('fnx_idCard:weaponLicense')
```

***

# Give Weapon License

### ESX

```lua theme={null}
local c, dis = ESX.Game.GetClosestPlayer()
TriggerServerEvent("fnx_idCard:givefirearm", GetPlayerServerId(c))
```

### QBCore

```lua theme={null}
local c, dis = QBCore.Functions.GetClosestPlayer()
TriggerServerEvent("fnx_idCard:givefirearm", GetPlayerServerId(c))
```

***

# Remove Weapon License

```lua theme={null}
TriggerServerEvent("fnx_idCard:retirefirearm", GetPlayerServerId(c))
```

***

# Give License to Yourself

```lua theme={null}
TriggerServerEvent("fnx_idCard:givefirearm", GetPlayerServerId(PlayerId()))
```

***

# Illegal Document Dialog

Trigger the **fake document creation menu**.

```lua theme={null}
local args = source
TriggerClientEvent('fnx_idcard:dialogIllegal', args)
```

***

# Update Photo via Trigger

```lua theme={null}
RegisterServerEvent('fnx_idcard:updatePhoto',function(link)
    local source = source
    local xPlayer = ServerGetPlayer(source)
    MySQL.Async.execute('UPDATE users SET idCardPhoto = ? WHERE identifier = ?', {link, xPlayer.identifier})
end)
```

Trigger example:

```lua theme={null}
TriggerServerEvent('fnx_idcard:updatePhoto', link)
```

Command example:

```lua theme={null}
RegisterCommand('updatephoto', function(arg)
    if arg[1] ~= nil then 
        TriggerServerEvent('fnx_idcard:updatePhoto', arg[1])
    else 
        print('You miss the argument for this command.')
    end 
end)
```

***

# Open Document Creation Menu

```lua theme={null}
TriggerEvent('fnx_idcard:takePhotoMoveCam')
```

You can use this trigger in **qb-cityhall** to create documents.

***

# Give Drive License

```lua theme={null}
TriggerServerEvent("fnx_idcard:giveDriveLicenseToPlayer",GetPlayerServerId(c))
```

Give to yourself:

```lua theme={null}
TriggerServerEvent("fnx_idcard:giveDriveLicenseToPlayer",GetPlayerServerId(PlayerId()))
```

***

# Create Document Plus

Steps:

1. Create the item in your inventory
2. Open `config.lua`
3. Add the item configuration

Parameters:

* `itemname` → inventory item
* `illegalallowed` → allow in fake document menu
* `bg` → background image

***

# Give Document Plus

```lua theme={null}
local license = "plane"
TriggerServerEvent("fnx_idCard:giveDocumentPlus", GetPlayerServerId(c), license)
```

***

# Remove Document Plus

```lua theme={null}
local license = "plane"
TriggerServerEvent("fnx_idCard:retireDocumentPlus", GetPlayerServerId(c), license)
```

***
