> For the complete documentation index, see [llms.txt](https://docs.pescripts.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pescripts.com/scripts/ppaneladmin/installation.md).

# Installation

{% stepper %}
{% step %}

#### Install

Install the resource on your Keymaster after purchasing the script. <mark style="color:$primary;">(</mark>[<mark style="color:$primary;">https://portal.cfx.re/</mark>](https://portal.cfx.re/)<mark style="color:$primary;">)</mark>&#x20;

{% endstep %}

{% step %}

#### Drag And Drop

Please place the PanelAdmin resource on your base.

{% endstep %}

{% step %}

### Start

Next, please ensure that the PanelAdmin resource is included in your `server.cfg` or `resources.cfg`.

{% endstep %}

{% step %}

### Config System

To configure PPanelAdmin, please open the `config.lua` and `permissions.lua` file. Then, you can adjust the system settings as needed.

{% endstep %}
{% endstepper %}

<details>

<summary>Here is the <code>config.lua</code> file. (ESX)</summary>

```lua
-----------------------------------------------
-- PPanelAdmin - Main Configuration
-- Configuration principale
-----------------------------------------------

Config = {}

-------------------------------------------------
-- Framework / Framework
-------------------------------------------------
Config.Framework = 'ESX'

-------------------------------------------------
-- Langue / Language
-------------------------------------------------
Config.Locale = 'en' -- fr / en 
-- FR: Langue utilisée pour les messages et traductions
-- EN: Language used for messages and translations

-------------------------------------------------
-- Debug Mode / Mode Debug
-------------------------------------------------
Config.Debug = true

-------------------------------------------------
-- ESX Resource Name / Nom de la ressource ESX
-------------------------------------------------
Config.ESXResource = "es_extended"

-------------------------------------------------
-- Command / Commande
-------------------------------------------------
Config.Command = 'ppadmin'

-------------------------------------------------
-- Keybind Settings / Paramètres de touche
-------------------------------------------------
Config.Keybind = 'F5'
-- FR: Touche pour ouvrir le menu (F5, F6, F7, etc.)
-- EN: Key to open the menu (F5, F6, F7, etc.)
-- Touches disponibles / Available keys: F5, F6, F7, F8, F9, F10, etc.

-------------------------------------------------
-- Notification System / Système de notifications
-------------------------------------------------
Config.Notifs = 'ESX' -- ESX / PNotif / Custom
-- FR: Type de système de notifications utilisé
-- EN: Type of notification system used
-- ESX: Utilise les notifications ESX natives
-- PNotif: Utilise le système PNotif
-- Custom: Utilise un système personnalisé (event 'admin:notify')

-------------------------------------------------
-- Inventory System / Système d'inventaire
-------------------------------------------------
Config.Inventory = 'auto' -- 'auto' = Auto-detect / 'default' = ESX Default / 'ox' = ox_inventory / 'qs' = Quasar Inventory / 'qb' = qb-inventory
-- FR: Système d'inventaire utilisé (auto détecte automatiquement)
-- EN: Inventory system used (auto detects automatically)

-------------------------------------------------
-- Item Images Path / Chemin des images d'items
-------------------------------------------------
-- Pour Quasar Inventory, les images doivent être placées dans:
-- [qs-inventory]/html/images/
-- Format: [item_name].png

Config.ItemImagesPath = 'nui://qs-inventory/html/images/'

-------------------------------------------------
-- Search Settings / Paramètres de recherche
-------------------------------------------------
Config.EnableSearch = true
Config.SearchMinChars = 2

-------------------------------------------------
-- Give Settings / Paramètres de don
-------------------------------------------------
Config.MaxAmount = 999999
Config.DefaultAmount = 1

Config.EnableMetadata = true

-------------------------------------------------
-- Player Display Settings / Affichage des joueurs
-------------------------------------------------
Config.ShowPlayerID = true
Config.ShowPlayerIdentifier = true

-------------------------------------------------
-- Discord Webhooks Logs / Logs Discord
-------------------------------------------------
Config.DiscordLogs = {
    enabled = true,

    webhooks = {
        itemGives = '',
        panelAccess = '',
        quotaReset = '',
        accessDenied = ''
    },

    colors = {
        itemGives = 5763719,
        panelAccess = 3447003,
        quotaReset = 10181046,
        accessDenied = 15158332
    },

    logItemGives = true,
    logPanelAccess = true,
    logQuotaReset = true,
    logAccessDenied = true,

    includeSteamInfo = true,
    includeLicenseInfo = true,
    includeDiscordInfo = true,
    includeServerInfo = false,

    thumbnail = 'https://i.imgur.com/YourImageHere.png',

    footer = {
        text = 'PPanelAdmin Logs',
        icon_url = 'https://i.imgur.com/YourIconHere.png'
    }
}

-------------------------------------------------
-- Quota Reset Timer / Timer de réinitialisation du quota
-------------------------------------------------
Config.QuotaResetEnabled = true
-- FR: Active la réinitialisation automatique du quota
-- EN: Enable automatic quota reset

Config.QuotaResetInterval = 24 * 60 * 60 -- en secondes (24 heures par défaut)
-- FR: Intervalle de réinitialisation en secondes
-- EN: Reset interval in seconds
-- Exemples / Examples:
-- 1 heure / 1 hour: 60 * 60 = 3600
-- 12 heures / 12 hours: 12 * 60 * 60 = 43200
-- 24 heures / 24 hours: 24 * 60 * 60 = 86400
-- 7 jours / 7 days: 7 * 24 * 60 * 60 = 604800

-------------------------------------------------
-- Traductions / Locales
-------------------------------------------------
LOCALES = {}

function _U(str, ...)
    if LOCALES[Config.Locale] ~= nil then
        if LOCALES[Config.Locale][str] ~= nil then
            return string.format(LOCALES[Config.Locale][str], ...)
        else
            return 'Translation [' .. str .. '] does not exist'
        end
    else
        return 'Locale [' .. Config.Locale .. '] does not exist'
    end
end

```

</details>

<details>

<summary>Here is the <code>permissions.lua</code> file. (ESX)</summary>

```lua
-----------------------------------------------
-- PPanelAdmin - Permissions Configuration
-- Configuration des permissions
-----------------------------------------------

Permissions = {}

-------------------------------------------------
-- Admin Groups / Groupes administrateurs (ESX)
-------------------------------------------------
-- Les groupes qui ont accès au panel (pour ESX)
Permissions.AllowedGroups = {
    'admin',
    'superadmin',
    'mod'
}

-------------------------------------------------
-- Specific Permissions / Permissions spécifiques
-------------------------------------------------
-- Permissions par identifiant de joueur (ESX)
-- Format: ["identifier"] = true
Permissions.AllowedIdentifiers = {
    -- ["steam:110000XXXXXXXX"] = true,
    -- ["license:XXXXXXXXXXXXXXX"] = true,
}

-------------------------------------------------
-- Item Restrictions / Restrictions d'items
-------------------------------------------------
-- Items qui ne peuvent pas être donnés
Permissions.RestrictedItems = {
    -- "weapon_specialcarbine_mk2",
    -- "black_money",
}

-------------------------------------------------
-- Amount Limits by Group / Limites de quantité par groupe (ESX)
-------------------------------------------------
Permissions.AmountLimits = {
    ['admin'] = 100000,
    ['superadmin'] = 999999,
    ['mod'] = 50000
}

-------------------------------------------------
-- Metadata Permissions / Permissions des métadonnées
-------------------------------------------------
-- Groupes qui peuvent ajouter des métadonnées
Permissions.CanUseMetadata = {
    'admin',
    'superadmin'
}

-------------------------------------------------
-- Functions / Fonctions
-------------------------------------------------

function Permissions:HasAccess(xPlayer)
    if not xPlayer then return false end

    local playerGroup = xPlayer.getGroup and xPlayer.getGroup() or xPlayer.group

    for _, group in ipairs(self.AllowedGroups) do
        if playerGroup == group then
            return true
        end
    end

    local identifier = xPlayer.getIdentifier()
    if self.AllowedIdentifiers[identifier] then
        return true
    end

    return false
end

function Permissions:GetMaxAmount(xPlayer)
    if not xPlayer then return Config.DefaultAmount end

    local playerGroup = xPlayer.getGroup and xPlayer.getGroup() or xPlayer.group
    return self.AmountLimits[playerGroup] or Config.MaxAmount
end

function Permissions:GetAdminRole(xPlayer)
    if not xPlayer then return nil end

    local playerGroup = xPlayer.getGroup and xPlayer.getGroup() or xPlayer.group

    for _, group in ipairs(self.AllowedGroups) do
        if playerGroup == group then
            return playerGroup
        end
    end

    return nil
end

function Permissions:CanGiveItem(itemName)
    for _, restricted in ipairs(self.RestrictedItems) do
        if restricted == itemName then
            return false
        end
    end
    return true
end

function Permissions:CanUseMetadata(xPlayer)
    if not xPlayer then return false end

    local playerGroup = xPlayer.getGroup and xPlayer.getGroup() or xPlayer.group

    local metadataGroups = {
        'admin',
        'superadmin'
    }

    for _, group in ipairs(metadataGroups) do
        if playerGroup == group then
            return true
        end
    end

    return false
end
```

</details>

<details>

<summary>Here is the <code>config.lua</code> file. (QBCore)</summary>

```lua
-----------------------------------------------
-- PPanelAdmin - Main Configuration
-- Configuration principale
-----------------------------------------------

Config = {}

-------------------------------------------------
-- Framework / Framework
-------------------------------------------------
Config.Framework = 'QBCore' 


-------------------------------------------------
-- Langue / Language
-------------------------------------------------
Config.Locale = 'en' -- fr / en 
-- FR: Langue utilisée pour les messages et traductions
-- EN: Language used for messages and translations

-------------------------------------------------
-- Debug Mode / Mode Debug
-------------------------------------------------
Config.Debug = true

-------------------------------------------------
-- QBCore Resource Name / Nom de la ressource QBCore
-------------------------------------------------
Config.QBResource = "qb-core"

-------------------------------------------------
-- Command / Commande
-------------------------------------------------
Config.Command = 'ppadmin'

-------------------------------------------------
-- Keybind Settings / Paramètres de touche
-------------------------------------------------
Config.Keybind = 'F5'
-- FR: Touche pour ouvrir le menu (F5, F6, F7, etc.)
-- EN: Key to open the menu (F5, F6, F7, etc.)
-- Touches disponibles / Available keys: F5, F6, F7, F8, F9, F10, etc.

-------------------------------------------------
-- Notification System / Système de notifications
-------------------------------------------------
Config.Notifs = 'QB' -- / PNotif / Custom / QB
-- FR: Type de système de notifications utilisé
-- EN: Type of notification system used
-- QB: Utilise les notifications QB natives
-- PNotif: Utilise le système PNotif
-- Custom: Utilise un système personnalisé (event 'admin:notify')

-------------------------------------------------
-- Inventory System / Système d'inventaire
-------------------------------------------------
Config.Inventory = 'auto' -- 'auto' = Auto-detect / 'default' = QB Default / 'ox' = ox_inventory / 'qs' = Quasar Inventory / 'qb' = qb-inventory
-- FR: Système d'inventaire utilisé (auto détecte automatiquement)
-- EN: Inventory system used (auto detects automatically)

-------------------------------------------------
-- Item Images Path / Chemin des images d'items
-------------------------------------------------
-- Pour Quasar Inventory, les images doivent être placées dans:
-- [qs-inventory]/html/images/
-- Format: [item_name].png

Config.ItemImagesPath = 'nui://qs-inventory/html/images/'

-------------------------------------------------
-- Search Settings / Paramètres de recherche
-------------------------------------------------
Config.EnableSearch = true
Config.SearchMinChars = 2

-------------------------------------------------
-- Give Settings / Paramètres de don
-------------------------------------------------
Config.MaxAmount = 999999
Config.DefaultAmount = 1

Config.EnableMetadata = true

-------------------------------------------------
-- Player Display Settings / Affichage des joueurs
-------------------------------------------------
Config.ShowPlayerID = true
Config.ShowPlayerIdentifier = true

-------------------------------------------------
-- Discord Webhooks Logs / Logs Discord
-------------------------------------------------
Config.DiscordLogs = {
    enabled = true,

    webhooks = {
        itemGives = '',
        panelAccess = '',
        quotaReset = '',
        accessDenied = ''
    },

    colors = {
        itemGives = 5763719,
        panelAccess = 3447003,
        quotaReset = 10181046,
        accessDenied = 15158332
    },

    logItemGives = true,
    logPanelAccess = true,
    logQuotaReset = true,
    logAccessDenied = true,

    includeSteamInfo = true,
    includeLicenseInfo = true,
    includeDiscordInfo = true,
    includeServerInfo = false,

    thumbnail = 'https://i.imgur.com/YourImageHere.png',

    footer = {
        text = 'PPanelAdmin Logs',
        icon_url = 'https://i.imgur.com/YourIconHere.png'
    }
}

-------------------------------------------------
-- Quota Reset Timer / Timer de réinitialisation du quota
-------------------------------------------------
Config.QuotaResetEnabled = true
-- FR: Active la réinitialisation automatique du quota
-- EN: Enable automatic quota reset

Config.QuotaResetInterval = 24 * 60 * 60 -- en secondes (24 heures par défaut)
-- FR: Intervalle de réinitialisation en secondes
-- EN: Reset interval in seconds
-- Exemples / Examples:
-- 1 heure / 1 hour: 60 * 60 = 3600
-- 12 heures / 12 hours: 12 * 60 * 60 = 43200
-- 24 heures / 24 hours: 24 * 60 * 60 = 86400
-- 7 jours / 7 days: 7 * 24 * 60 * 60 = 604800

-------------------------------------------------
-- Traductions / Locales
-------------------------------------------------
LOCALES = {}

function _U(str, ...)
    if LOCALES[Config.Locale] ~= nil then
        if LOCALES[Config.Locale][str] ~= nil then
            return string.format(LOCALES[Config.Locale][str], ...)
        else
            return 'Translation [' .. str .. '] does not exist'
        end
    else
        return 'Locale [' .. Config.Locale .. '] does not exist'
    end
end

```

</details>

<details>

<summary>Here is the <code>permissions.lua</code> file. (QBCore)</summary>

```lua
-----------------------------------------------
-- PPanelAdmin - Permissions Configuration
-- Configuration des permissions
-----------------------------------------------

Permissions = {}


-------------------------------------------------
-- Admin Permissions (QBCore)
-------------------------------------------------
-- Permissions QBCore (basées sur license)
-- Format: ["license:XXXXXXXXXXXXXXX"] = true
Permissions.AllowedLicenses = {
    -- ["license:XXXXXXXXXXXXXXX"] = true,
    -- ["license:YYYYYYYYYYYYYYY"] = true,
}

-------------------------------------------------
-- Item Restrictions / Restrictions d'items
-------------------------------------------------
-- Items qui ne peuvent pas être donnés
Permissions.RestrictedItems = {
    -- "weapon_specialcarbine_mk2",
    -- "black_money",
}


-------------------------------------------------
-- Amount Limits by License (QBCore)
-------------------------------------------------
Permissions.AmountLimitsByLicense = {
    -- ["license:XXXXXXXXXXXXXXX"] = 100000,
    -- ["license:YYYYYYYYYYYYYYY"] = 50000,
}


-------------------------------------------------
-- Functions / Fonctions
-------------------------------------------------

function Permissions:HasAccess(xPlayer)
    if not xPlayer then return false end

    local license = xPlayer.PlayerData.license
    if self.AllowedLicenses[license] then
        return true
    end

    return false
end

function Permissions:GetMaxAmount(xPlayer)
    if not xPlayer then return Config.DefaultAmount end

    local license = xPlayer.PlayerData.license
    return self.AmountLimitsByLicense[license] or Config.MaxAmount
end

function Permissions:GetAdminRole(xPlayer)
    if not xPlayer then return nil end

    local license = xPlayer.PlayerData.license
    if self.AllowedLicenses[license] then
        return 'admin'
    end

    return nil
end

function Permissions:CanGiveItem(itemName)
    for _, restricted in ipairs(self.RestrictedItems) do
        if restricted == itemName then
            return false
        end
    end
    return true
end

function Permissions:CanUseMetadata(xPlayer)
    if not xPlayer then return false end

    local license = xPlayer.PlayerData.license
    return self.AllowedLicenses[license] or false
end

```

</details>
