# Install

<div className="fd-steps [&_h3]:fd-step">
  ### Download the Resource [#download-the-resource]
  Download the resource from the [Cfx.re Portal](https://portal.cfx.re/) after purchasing.

  ### Extract and Place into Resources [#extract-and-place-into-resources]
  Download the file, extract it, and place it in your server's resource folder.

  ### Update Config [#update-config]
  Make sure to include the resource in your `server.cfg` if you haven't already.  
  The resource should be started after your framework and `ox_lib`.

  <Tabs groupId="framework" persist items={["ESX", "QB"]}>
    <Tab value="ESX">
      ```
      ensure es_extended
      ensure ox_lib
      ensure illenium-appearance
      ```
    </Tab>
    <Tab value="QB">
      ```
      ensure qb-core
      ensure ox_lib
      ensure illenium-appearance
      ```
    </Tab>
  </Tabs>

  ### Conflicting Resources [#conflicting-resources]
  <Callout type="warn">
  You must remove any other appearance editor from your server, as this one overrides them.
  </Callout>

  <Tabs groupId="framework" persist items={["ESX", "QB"]}>
    <Tab value="ESX">
      - esx_skin
      - skinchanger
      - fivem-appearance
      - esx_barbershop
      - esx_clotheshop
    </Tab>
    <Tab value="QB">
      - qb-clothing
      - fivem-appearance
      - qb-tattooshop
    </Tab>
  </Tabs>

  ### Install SQL to Database [#install-sql-to-database]
  ```sql title="sql.sql"
  CREATE TABLE IF NOT EXISTS `management_outfits` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `job_name` varchar(50) NOT NULL,
    `type` varchar(50) NOT NULL,
    `minrank` int(11) NOT NULL DEFAULT 0,
    `name` varchar(50) NOT NULL DEFAULT 'Cool Outfit',
    `gender` varchar(50) NOT NULL DEFAULT 'male',
    `model` varchar(50) DEFAULT NULL,
    `props` varchar(1000) DEFAULT NULL,
    `components` varchar(1500) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;

  CREATE TABLE IF NOT EXISTS `playerskins` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `citizenid` varchar(255) NOT NULL,
    `model` varchar(255) NOT NULL,
    `skin` text NOT NULL,
    `active` tinyint(4) NOT NULL DEFAULT 1,
    PRIMARY KEY (`id`),
    KEY `citizenid` (`citizenid`),
    KEY `active` (`active`)
  ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;

  CREATE TABLE IF NOT EXISTS `player_outfits` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `citizenid` varchar(50) DEFAULT NULL,
    `outfitname` varchar(50) NOT NULL DEFAULT '0',
    `model` varchar(50) DEFAULT NULL,
    `props` varchar(1000) DEFAULT NULL,
    `components` varchar(1500) DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `citizenid_outfitname_model` (`citizenid`,`outfitname`,`model`),
    KEY `citizenid` (`citizenid`)
  ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;

  CREATE TABLE IF NOT EXISTS `player_outfit_codes` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `outfitid` int(11) NOT NULL,
    `code` varchar(50) NOT NULL DEFAULT '',
    PRIMARY KEY (`id`),
    KEY `FK_player_outfit_codes_player_outfits` (`outfitid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  ```

  ### Framework Changes [#framework-changes]
  <Tabs groupId="framework" persist items={["ESX", "QB"]}>
    <Tab value="ESX">
      Add a "provides" section to the `fxmanifest.lua` of `illenium-appearance` so other ESX resources don't throw errors.

      ```lua
      provides({ "esx_skin", "skinchanger" })
      ```
    </Tab>
    <Tab value="QB">
      Remove the `qb-clothing` dependency from the `fxmanifest.lua` of both `qb-houses` and `qb-apartments`.

      ```diff
      dependencies {
          'qb-core',
          'qb-vehicles',
      -   'qb-clothing',
          'qb-interior'
      }
      ```
    </Tab>
  </Tabs>

  ### Configure the Resource [#configure-the-resource]
  You can now configure the resource; all configs are in the `shared` folder.

  ### Restart Server [#restart-server]
  Once you've completed all the steps above, you should be set.
</div>
