Skip to content

Installation ​

This guide will walk you through installing prp-notebook on your FiveM server.

Installation steps

1
Download the resource
Download prp-notebook from the CFX portal and place it in your resources folder.
2
Add to server.cfg
Add prp-notebook to your server.cfg after all dependencies.
ensure oxmysql
ensure ox_lib
ensure prp-bridge
ensure prp-notebook
3
Add item
Add the required item to your inventory resource — see Items below.
4
Configure
Open config.lua to configure the image domain allowlist and the item name if needed.
5
Optional: inventory icons
Custom inventory icons are included in the installation/inventory icons folder. Copy them to your inventory resource's image directory if you'd like to use them.

Items ​

Add the item below to your inventory resource using the format appropriate for your setup.

Add the item below to your ox_inventory into data/items.lua.

lua
["notebook"] = {
    label = "Notebook",
    weight = 200,
    buttons = {
        {
            label = "Duplicate",
            action = function(slot)
                TriggerServerEvent("prp-notebook:server:duplicateNotebook", slot)
            end
        }
    },
},

Database ​

The required tables are created automatically on first server start:

sql
CREATE TABLE IF NOT EXISTS `notebooks` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `title` VARCHAR(80) NOT NULL,
    `color` VARCHAR(7),
    `owner` VARCHAR(50) NOT NULL,
    `is_original` BOOLEAN DEFAULT FALSE,
    `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP() NULL,
    INDEX(`owner`)
) CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS `notebook_pages` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `page_number` INT NOT NULL,
    `notebook_id` INT NOT NULL,
    `content` LONGTEXT NOT NULL,
    `images` LONGTEXT NOT NULL,
    `drawing` LONGTEXT NOT NULL,
    `updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP() NULL,
    INDEX(`notebook_id`),
    INDEX(`page_number`),
    FOREIGN KEY (`notebook_id`) REFERENCES `notebooks`(`id`) ON DELETE CASCADE
) CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;