# Installation

This script is designed to work seamlessly with <mark style="color:blue;">**ESX**</mark> and <mark style="color:red;">**QBCore/QBOX**</mark> frameworks.\
The configuration is the same for all frameworks and requires no additional steps.

***

## Install Dependencies

<table><thead><tr><th width="367">Resource</th><th>Download</th></tr></thead><tbody><tr><td>ox_lib</td><td><a href="https://github.com/overextended/ox_lib/releases">Download</a></td></tr></tbody></table>

## Insert SQL

You can use the `insert.sql` file included in the script or copy its contents and execute them to set it up in your database.

```sql
CREATE TABLE IF NOT EXISTS `clothing_zones` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `coords` longtext NOT NULL,
    `jobs` longtext NOT NULL,
    `created_by` varchar(50) DEFAULT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `job_outfits` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `job_name` varchar(50) NOT NULL,
    `outfit_name` varchar(100) NOT NULL,
    `outfit_data` longtext NOT NULL,
    `created_by` varchar(50) DEFAULT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    KEY `job_name` (`job_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 

CREATE TABLE IF NOT EXISTS `boss_transactions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `job` varchar(50) DEFAULT NULL,
  `type` varchar(50) DEFAULT NULL,
  `amount` int(11) DEFAULT 0,
  `target_name` varchar(255) DEFAULT NULL,
  `source_name` varchar(255) DEFAULT NULL,
  `old_rank` varchar(50) DEFAULT NULL,
  `new_rank` varchar(50) DEFAULT NULL,
  `date` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; 

CREATE TABLE IF NOT EXISTS `society_accounts` (
    `job` VARCHAR(50) NOT NULL COLLATE 'utf8_general_ci',
    `money` INT(11) NULL DEFAULT '0',
    PRIMARY KEY (`job`) USING BTREE
) COLLATE='utf8_general_ci';
```

## Set Clothing

```lua
Config.Clothing = function(playerPed)
    if GetResourceState('illenium-appearance') == 'started' then
        local appearance = exports["illenium-appearance"]:getPedAppearance(playerPed)
        TriggerServerEvent("illenium-appearance:server:saveAppearance", appearance)
    elseif GetResourceState('fivem-appearance') == 'started' then
	local appearance = exports['fivem-appearance']:getPedAppearance(playerPed)
	TriggerServerEvent('fivem-appearance:save', appearance)
    elseif GetResourceState('qb-clothing') == 'started' then
        TriggerServerEvent("qb-clothes:loadPlayerSkin")
    elseif GetResourceState('esx_skin') == 'started' then
        TriggerEvent('skinchanger:getSkin', function(skin)
            if skin then
                TriggerServerEvent('esx_skin:save', skin)
            end
        end)
    end
end
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://bbstore.gitbook.io/docs/resources/bb-bossmenu/installation.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.
