Skip to main content
Image

Image Upload Setup

To enable document photos, you must configure an uploader in: imageuploader.lua

Discord

Set the system to:
discord
Then add your Discord webhook.
Discord may delete uploaded images after 1–2 days.

FiveManage

Set the system to:
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

Using ox_inventory

Add the following items to your ox inventory items file.
['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.
["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.
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
["documents"] = {
    color = "#f2f2f2",
    takeSound = 'take',
    putSound = 'put',
    stack = 1
},
Update CloseAfterUse
"documents", "weapon", "drive", "plane", "boat"

Date of Birth Error

If you encounter a date of birth error, check:
config.js
Make sure:
  • date format is correct
  • separator is correct
Example: dob error

Weapon License Menu

Open the weapon license menu:
TriggerEvent('fnx_idCard:weaponLicense')

Give Weapon License

ESX

local c, dis = ESX.Game.GetClosestPlayer()
TriggerServerEvent("fnx_idCard:givefirearm", GetPlayerServerId(c))

QBCore

local c, dis = QBCore.Functions.GetClosestPlayer()
TriggerServerEvent("fnx_idCard:givefirearm", GetPlayerServerId(c))

Remove Weapon License

TriggerServerEvent("fnx_idCard:retirefirearm", GetPlayerServerId(c))

Give License to Yourself

TriggerServerEvent("fnx_idCard:givefirearm", GetPlayerServerId(PlayerId()))

Illegal Document Dialog

Trigger the fake document creation menu.
local args = source
TriggerClientEvent('fnx_idcard:dialogIllegal', args)

Update Photo via Trigger

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:
TriggerServerEvent('fnx_idcard:updatePhoto', link)
Command example:
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

TriggerEvent('fnx_idcard:takePhotoMoveCam')
You can use this trigger in qb-cityhall to create documents.

Give Drive License

TriggerServerEvent("fnx_idcard:giveDriveLicenseToPlayer",GetPlayerServerId(c))
Give to yourself:
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

local license = "plane"
TriggerServerEvent("fnx_idCard:giveDocumentPlus", GetPlayerServerId(c), license)

Remove Document Plus

local license = "plane"
TriggerServerEvent("fnx_idCard:retireDocumentPlus", GetPlayerServerId(c), license)