Installation

Prepare and install dependencies

Framework dependencies (supported by current bridge)

For framework, you can either choose:

You also need an inventory:

Download

Please make sure that you have downloaded the Release version, since it has prebuilt UI. Otherwise, you'll need to build the UI yourself.

 cd fd_laptop/web
 pnpm i
 pnpm build

Add inventory items

ox_inventory/data/items.lua
  ['laptop'] = {
      label = 'Facade Laptop',
      description = 'A high-tech gadget that is always up to something',
      stack = false,
      close = false,
      consume = 0,
      client = {
          image = 'fd_laptop.png',
      },
      server = {
          export = 'fd_laptop.useLaptop'
      },
      buttons = {
          {
              label = "Open storage",
              action = function(slot)
                  TriggerServerEvent("fd_laptop:server:openLaptopStorage", slot)
              end
          }
      }
  },

Run SQL query

In your database, run the provided query below.

  CREATE TABLE
      `fd_laptop` (
          `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
          `identifier` varchar(50) DEFAULT NULL,
          `background` varchar(50) NOT NULL DEFAULT '1.src',
          `dark_mode` tinyint(1) NOT NULL DEFAULT 1,
          `username` varchar(255) DEFAULT NULL,
          `profile_picture` varchar(255) DEFAULT NULL,
          `installedApps` varchar(255) NOT NULL DEFAULT '[]',
          `desktopApps` JSON NOT NULL DEFAULT '[]',
      PRIMARY KEY (`id`),
      UNIQUE KEY `id` (`id`),
      UNIQUE KEY `idx_fd_laptop_identifier` (`identifier`),
      UNIQUE KEY `idx_fd_laptop_username` (`username`)
  ) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci

Configuration

Please ensure, that everything is configured as you like in configs directory.

Optional

As an optional thing, we also included item image, in optional directory, you can copy it to ox_inventory/web/images/ directory.

Start resource

Make sure, resource is started after ox_lib and oxmysql.

  ensure oxmysql
  ensure ox_lib
  ...
  ensure fd_laptop