# 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
```
