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
['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 Built-in app tables (auto-created)
The following tables are created automatically on first start. You do not need to run these manually, but they are listed here for reference.
Notes
CREATE TABLE IF NOT EXISTS `fd_laptop_notes` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`identifier` VARCHAR(255) NOT NULL,
`title` VARCHAR(255) NOT NULL DEFAULT '',
`content` LONGTEXT NULL,
`color` VARCHAR(20) NOT NULL DEFAULT '#FFE56D',
`pinned` TINYINT(1) NOT NULL DEFAULT 0,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
INDEX `idx_identifier` (`identifier`)
)CREATE TABLE IF NOT EXISTS `fd_laptop_email_accounts` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`identifier` VARCHAR(255) NOT NULL,
`address` VARCHAR(255) NOT NULL UNIQUE,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX `idx_identifier` (`identifier`),
INDEX `idx_address` (`address`)
)
CREATE TABLE IF NOT EXISTS `fd_laptop_emails` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`owner_address` VARCHAR(255) NOT NULL,
`from_address` VARCHAR(255) NOT NULL,
`to_address` VARCHAR(255) NOT NULL,
`subject` VARCHAR(500) NOT NULL DEFAULT '',
`body` LONGTEXT NULL,
`folder` ENUM('inbox', 'sent', 'trash') NOT NULL DEFAULT 'inbox',
`is_read` TINYINT(1) NOT NULL DEFAULT 0,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX `idx_owner_folder` (`owner_address`, `folder`),
INDEX `idx_created` (`created_at`)
)Calendar
CREATE TABLE IF NOT EXISTS `fd_laptop_calendar_events` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`identifier` VARCHAR(255) NULL,
`title` VARCHAR(255) NOT NULL,
`description` TEXT NULL,
`date` DATE NOT NULL,
`time` VARCHAR(5) NULL,
`image_url` TEXT NULL,
`is_shared` TINYINT(1) NOT NULL DEFAULT 0,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX `idx_date` (`date`),
INDEX `idx_identifier` (`identifier`)
)
CREATE TABLE IF NOT EXISTS `fd_laptop_calendar_reminders` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`event_id` INT NOT NULL,
`identifier` VARCHAR(255) NOT NULL,
UNIQUE KEY `unique_reminder` (`event_id`, `identifier`)
)SpellMe
CREATE TABLE IF NOT EXISTS `fd_laptop_spellme` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`identifier` VARCHAR(255) NOT NULL,
`username` VARCHAR(255) NOT NULL,
`word` VARCHAR(10) NOT NULL,
`date` DATE NOT NULL,
`guesses` TEXT NOT NULL,
`attempts` INT NOT NULL DEFAULT 0,
`won` TINYINT(1) NOT NULL DEFAULT 0,
`completed` TINYINT(1) NOT NULL DEFAULT 0,
`completed_at` TIMESTAMP NULL,
UNIQUE KEY `unique_player_date` (`identifier`, `date`)
)
CREATE TABLE IF NOT EXISTS `fd_laptop_spellme_words` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`word` VARCHAR(10) NOT NULL,
`date` DATE NOT NULL UNIQUE
)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