> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revoscripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install Revo Stock Trading and set it up on your FiveM server.

<Steps>
  <Step title="Download Stock Trading">
    Visit the <a href="https://keymaster.fivem.net/" target="_blank">FiveM Keymaster</a> and download the latest version of **Revo Stock Trading**. Save the script to your computer.
  </Step>

  <Step title="Add to Resources">
    Place the downloaded <code>revo\_stocktrading</code> folder inside your server's <code>resources</code> directory.
  </Step>

  <Step title="Import Required SQL Files">
    Import the following SQL files into your server database in this exact order:

    <ul>
      <li><code>stocks.sql</code></li>
      <li><code>trade\_users.sql</code></li>
      <li><code>trade\_daily\_limits.sql</code></li>
      <li><code>trades.sql</code></li>
    </ul>

    <Note>
      Import the SQL files in the specified order to ensure proper table relationships and foreign key constraints.
    </Note>
  </Step>

  <Step title="Configure server.cfg">
    Ensure dependencies and the resource are started in the correct order:

    ```bash theme={null}
      ensure oxmysql
      ensure revo_stocktrading
    ```
  </Step>

  <Step title="Add Trading Tablet to Your Inventory System">
    Revo Stock Trading supports the following inventory systems. Choose the one you're using and follow the corresponding instructions:

    <Tabs>
      <Tab title="ox_inventory">
        Open your `ox_inventory/data/items.lua` file and add the following items:

        ```lua theme={null}
        ['revo_trading_tablet'] = {
          label = 'Trading Tablet',
          weight = 500,
          stack = false,
          close = true,
          description = "Access trading panel.",
          client = {
            image = 'revo_trading_tablet.png',
          }
        }
        ```

        Add images (from `items-images` folder of `revo_stocktrading`) to: `ox_inventory/web/images/`

        * revo\_trading\_tablet.png
      </Tab>

      <Tab title="qb-inventory">
        Open your `qb-core/shared/items.lua` file and add the following items:

        ```lua theme={null}
        ['revo_trading_tablet'] = {
          name = 'revo_trading_tablet',
          label = 'Trading Tablet',
          weight = 500,
          type = 'item',
          image = 'revo_trading_tablet.png',
          unique = false,
          useable = true,
          shouldClose = true,
          description = 'Access trading panel.'
        }
        ```

        Add images (from `items-images` folder of `revo_stocktrading`) to: `qb-inventory/html/images/`

        * revo\_trading\_tablet.png
      </Tab>

      <Tab title="qs-inventory">
        For ESX servers: Add the following items to `qs-inventory/shared/items.lua`

        For QBCore servers: Add the same items to `qb-core/shared/items.lua`

        ```lua theme={null}
        ['revo_trading_tablet'] = {
          name = 'revo_trading_tablet',
          label = 'Trading Tablet',
          weight = 500,
          type = 'item',
          image = 'revo_trading_tablet.png',
          unique = false,
          useable = true,
          shouldClose = true,
          description = 'Access trading panel.'
        }
        ```

        Add images (from `items-images` folder of `revo_stocktrading`) to: `qs-inventory/html/images/`

        * revo\_trading\_tablet.png
      </Tab>
    </Tabs>
  </Step>

  <Step title="Start the Resource">
    Restart your server or run these commands in the server console:

    ```bash theme={null}
      refresh
      ensure revo_stocktrading
    ```
  </Step>
</Steps>

<Tip>
  Make sure your inventory system is restarted after adding the trading tablet item to load the new item properly.
</Tip>
