Skip to content

Setup and Database

Full installation, Windows and Linux host setup, server.cfg permissions, and database steps for 0r-clothing_designer

Full installation, Windows and Linux host setup, server.cfg permissions, and database steps for 0r-clothing_designer

This page is the full first-time install guide.

If you follow the steps in order, the resource should be ready to use when you finish.

1. What You Need Before You Start#

Prepare these items first:

  • a FiveM server
  • 0r_lib
  • ox_lib
  • oxmysql
  • the full [clothing_designer] package
  • permission to edit server.cfg
  • permission to import SQL if saved designs will be enabled

The package should include:

text
[clothing_designer]/
  0r-clothing_designer/
  0r-clothing_exports/

2. Official Downloads and Sources#

Use these sources:

3. Understand the Worker Requirement#

The resource already runs inside FiveM JS because the resource includes:

lua
node_version "22"

You do not usually need to install system Node just to make the resource start.

Current default:

lua
Config.Worker.Mode = "external"

That means:

  • heavy worker actions run in a separate local daemon process
  • this reduces pressure on the FiveM JS runtime
  • if external start fails, you can switch to inprocess manually

4. Place the Resource Package#

Copy the full package into your resources folder.

Recommended layout:

text
resources/
  [standalone]/
    ox_lib/
    oxmysql/
  [0resmon]/
    0r_lib/
  [custom]/
    [clothing_designer]/
      0r-clothing_designer/
      0r-clothing_exports/

Important folders inside 0r-clothing_designer:

  • ui/
  • templates/cloth_templates/
  • templates/template_previews/
  • templates/template_slots/
  • exports/
  • [installation]/database.sql
  • config/init.lua

5. Host Setup for Windows#

Use this section if your server host OS is Windows.

Step 1: verify Windows PowerShell#

Run this command on the host:

powershell
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -Command '$PSVersionTable.PSVersion.ToString()'

If this returns a version string, the default PowerShell requirement is ready.

If powershell.exe from PATH gives Access is denied, use the full System32 path shown above instead of the shorter powershell.exe form.

Step 2: optional PowerShell 7 install#

You do not need this if the built-in Windows PowerShell works.

If you want PowerShell 7:

  1. open the official Microsoft page
  2. download the installer for your host
  3. install it
  4. verify it with:
powershell
pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()'

If you want to force that exact executable later, use:

lua
Config.Worker.PowerShellPath = "C:/Program Files/PowerShell/7/pwsh.exe"

Step 3: optional Node install#

Install system Node only if one of these is true:

  • external worker Node resolution fails
  • you want to force a specific executable path

If needed:

  1. open nodejs.org
  2. install the current LTS release
  3. verify with:
powershell
node -v

If you want to force that exact executable later, use:

lua
Config.Worker.NodePath = "C:/Program Files/nodejs/node.exe"

6. Host Setup for Linux#

Use this section if your server host OS is Linux.

PowerShell is required on Linux because the worker uses pwsh.

Step 1: install PowerShell on Ubuntu#

Run:

bash
sudo apt-get update
sudo apt-get install -y wget apt-transport-https software-properties-common
source /etc/os-release
wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y powershell

Step 2: verify PowerShell#

Run:

bash
pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()'

If this returns a version string, the Linux PowerShell requirement is ready.

If you want to force that path later, use:

lua
Config.Worker.PowerShellPath = "/usr/bin/pwsh"

Step 3: optional Node install#

Install system Node only if external Node resolution fails or you want an explicit path.

If needed:

  1. open nodejs.org
  2. install the current LTS release for your Linux host
  3. verify with:
bash
node -v

If you want to force that path later, use:

lua
Config.Worker.NodePath = "/usr/bin/node"

7. Add Required server.cfg Lines#

Add the dependency start order first:

cfg
ensure ox_lib
ensure oxmysql
ensure 0r_lib
ensure [clothing_designer]

Then add the required permissions:

cfg
add_unsafe_child_process_permission 0r-clothing_designer
add_filesystem_permission 0r-clothing_designer write 0r-clothing_exports

Optional compatibility permission:

cfg
add_unsafe_worker_permission 0r-clothing_designer

What they do:

  • add_unsafe_child_process_permission lets the resource start child processes for worker and PowerShell-backed actions
  • add_filesystem_permission lets the resource write synchronized addon export files into 0r-clothing_exports
  • add_unsafe_worker_permission not required by the current code path, but safe to keep if you already use a standard permission block

8. Import the SQL If You Want Saved Designs#

If players should be able to save designs, import:

Database SQL

The SQL file inside the package is:

text
[clothing_designer]/0r-clothing_designer/[installation]/database.sql

Recommended order:

  1. start oxmysql
  2. import the SQL
  3. restart 0r-clothing_designer

If you do not want saved designs, set:

lua
Config.SavedDesigns.Enabled = false

9. Review the Main Config#

Open:

text
[clothing_designer]/0r-clothing_designer/config/init.lua

Check these sections before first start:

  • Config.Worker
  • Config.AI
  • Config.SavedDesigns

The full config guide is here:

Configuration

10. Add Templates#

Place template .ydd files under:

text
templates/cloth_templates/<male|female>/<component>/

Example:

text
templates/cloth_templates/male/jbib/jbib_000_u.ydd
templates/cloth_templates/female/lowr/lowr_000_r.ydd

If you need the full file-placement guide, read:

Adding a New YDD or YTD

11. Start the Resource#

Start the package:

cfg
ensure [clothing_designer]

If template files changed while the server was already running, use:

text
refresh
restart 0r-clothing_designer

After exporting new addon clothing, use:

text
restart 0r-clothing_exports

12. Validate Startup Logs#

When Config.Worker.Mode = "external", look for logs like these:

text
[0r-clothing_designer][worker] mode=external
[0r-clothing_designer][worker] external node=...
[0r-clothing_designer][worker] external daemon started pid=...

If the worker cannot start and you need a fast fallback, switch to:

lua
Config.Worker.Mode = "inprocess"

Then restart the resource.

13. Validate In Game#

Check these in order:

  1. the UI opens for an authorized admin
  2. templates appear in the template list
  3. opening a template creates a working editor session
  4. preview and slot preview load
  5. export completes
  6. output appears in 0r-clothing_designer/exports
  7. mirrored addon files appear in 0r-clothing_exports
  8. saved designs work if enabled
  9. AI generation works if enabled

14. When Installation Is Finished#

At this point the setup is complete.

If something still fails, continue with:

Troubleshooting