Docs
Rarx Clothing cover

Rarx Clothing

Rarx Clothing

Full-featured clothing store system with stock management, outfits, and appearance editor

  • Qbox
  • QBCore
  • ESX
  • rarx_clothing

Overview#

RARX Clothing is a comprehensive clothing store system for FiveM featuring photo-grid item browsing, stock management, outfit saving, a full appearance editor, cart-based purchasing, job outfits, and an admin panel. The framework is auto-detected at runtime.

Features#

Clothing Stores

Configurable store locations with per-category pricing, multiple payment methods, and blip markers

Photo Grid

Visual item browsing with rendered thumbnails instead of numeric selectors

Outfit System

Save, load, and manage outfits per character with quick-equip support

Appearance Editor

Full face, hair, makeup, and body customization with bone-relative camera zones

Cart System

Add multiple items to cart and purchase them all at once with bank or cash

Admin Panel

Create and manage stores, import stock, configure global items and per-store inventory

Job Outfits

Faction-specific outfit stations where bosses can manage work attire for their employees

Ped Selector

Browse and select ped models during character creation with optional freemode-only restriction

Requirements#

  • Framework: ESX, QBCore, or QBox (auto-detected)
  • ox_lib
  • oxmysql
  • rarx_lib
  • rarx_clothing_screenshot (optional, for photo grid thumbnails)

Installation#

  1. Download & Extract

    Download the latest version from your Keymaster and extract it to your server's resources folder.

  2. Import Database

    Import the included SQL file to create the required tables for stores, stock, and outfits.

  3. Add to server.cfg

    server.cfg
    ensure rarx_clothing

    Make sure ox_lib, oxmysql, and rarx_lib are started before this resource.

  4. Optional: Photo Grid Screenshots

    If you want the photo grid feature, also start the screenshot helper:

    server.cfg
    ensure rarx_clothing_screenshot
  5. Configure

    Edit config/_general.lua to customize settings. Store locations are managed through the in-game admin panel.

Framework-Specific Notes#

No additional setup required. QBox is detected automatically and uses the same QBCore-compatible API via GetCoreObject().

No additional setup required. The script auto-detects QBCore.

No additional setup required. The script auto-detects ESX.

Configuration#

General Settings#

Lua
Config.Debug = false

-- Visual item browsing with rendered thumbnails
Config.PhotoGrid = true

-- Require purchase before applying items
Config.ShopMode = true

-- Hide thumbnails and use number-based inputs only
Config.InputMode = false

-- Fix wet-cloth physics bug during rainy weather
Config.FixWetClothPhysics = true

Commands#

Lua
Config.Cmds = {
    management = 'clothing',  -- Open store management panel
    fixSkin    = 'fixpj',     -- Reapply stored appearance
    clothing   = 'skin',      -- Open clothing editor
    peds       = 'pedmenu',   -- Browse ped models
    creator    = 'creator',   -- Start character creation
}

Admin Permissions#

Lua
-- Roles that can access the management panel (empty = unrestricted)
Config.Permissions = {
    'god',
    'superadmin',
    'admin',
}

Payment & Pricing#

Lua
Config.DefaultPaymentMethod = 'bank'

Config.PaymentMethods = {
    ['cash'] = true,
    ['bank'] = true,
    ['xp']   = false,
}

-- Fallback price when no category-specific price is set
Config.BasePrice = 10

-- Per-category price overrides
Config.CategoryPricing = {
    ['masks']     = 100,
    ['jackets']   = 100,
    ['shirts']    = 100,
    ['legs']      = 100,
    ['shoes']     = 100,
    ['hats']      = 100,
    ['glasses']   = 100,
    -- ... and more
}

Interaction Method#

Lua
Config.Access = {
    -- 'auto' = auto-detect target, fallback to drawtext
    -- 'drawtext' = proximity prompt with E key
    -- 'ox_target' = ox_target eye interaction
    -- 'qb-target' = qb-target eye interaction
    system = 'auto',

    -- Text prompt backend (when using drawtext)
    -- 'auto' | 'ox_lib' | 'qb-core' | 'gta'
    textUI = 'auto',
}

3D Store Markers#

Lua
Config.Indicator = {
    enabled = true,
    renderDistance = 30,
    presets = {
        clothes = 'clothing',
        barber  = 'barber',
        masks   = 'clothing',
    },
}

Store Types & Blips#

Lua
Config.ShopTypes = {
    clothes = {
        blip  = { sprite = 73, color = 4, scale = 0.7, name = "Clothes Store" },
        label = "Clothes Store",
    },
    barber = {
        blip  = { sprite = 71, color = 4, scale = 0.7, name = "Barber" },
        label = "Barber Shop",
    },
    masks = {
        blip  = { sprite = 362, color = 4, scale = 0.7, name = "Mask Store" },
        label = "Mask Store",
    },
}

Character Creation#

Lua
-- Interior coordinates for the creation ped
Config.SpawnPoint = vector3(-813.97, 175.11, 76.74)

-- Allow picking any ped model (non-freemode skips face/appearance steps)
Config.AllowPedSelection = false

-- Height slider via SetEntityMatrix scaling
Config.ScaleSystem = {
    enabled = true,
    min = 0.85,
    max = 1.15,
    default = 1.0,
}

Job Outfit Stations#

Lua
Config.WorkAttire = {
    enable = false,
    bossGrade = {
        ['police']    = 2,
        ['ambulance'] = 2,
    },
    locations = {
        ['police']    = {},
        ['ambulance'] = {},
    },
}

Store Management#

Stores are created and managed through the in-game admin panel, accessible via the /clothing command (or your configured command).

Creating a Store#

  1. Run the management command (default: /clothing)
  2. Use the Store Wizard to create a new store
  3. Set the store name, type (clothes, barber, masks), and location
  4. Configure which categories are available in the store
  5. Import stock items using the import tool

Store Types#

Type Description
clothes Full clothing store with all categories
barber Hair, beard, and makeup customization
masks Mask-only store

Stock Management#

  • Global Items -- Items available across all stores of the same type
  • Store Items -- Items specific to a single store location
  • Import Tool -- Bulk import items with progress tracking

Admin Features#

Access the admin panel with the configured command (default: /clothing). Requires one of the roles defined in Config.Permissions.

  • Create, edit, and delete store locations
  • Manage global and per-store stock
  • Bulk import items with the import wizard
  • Configure store categories and pricing

Localization#

Translation files are available in the translates/ folder. Supported languages:

  • English (en)
  • Spanish (es)

Set the language via server convar:

server.cfg
setr rarx-lang "en"

Exports & Events API#

All exports and events are listed with their real signatures (as defined in the resource), parameter types, return values, and a usage example. Events are split by direction (who triggers vs who listens).

Client Exports#

Appearance#

GetAppearanceData(ped?)export → table

Returns the full appearance of a ped: { model, headBlendData, faceFeatures, headOverlays, hairTint, eyeColor, drawables, props, pedScale }. If ped is nil, defaults to PlayerPedId().

Lua
local skin = exports.rarx_clothing:GetAppearanceData()
-- or for another entity
local npcSkin = exports.rarx_clothing:GetAppearanceData(npcEntity)

Applies an appearance table (same shape as GetAppearanceData returns) to a ped. If skipModelLoad = true, the caller is responsible for having already loaded data.model.

Lua
exports.rarx_clothing:SetAppearance(PlayerPedId(), storedSkin, false)
SetDefaultPedValues()export → —

Resets face blend data, features, and overlays on the current ped to neutral defaults. Does not touch clothing.

Fetches the player's saved appearance from the server and applies it. Optional model string forces a specific ped model before applying.

Lua
exports.rarx_clothing:ReloadAppearanceData()            -- current saved
exports.rarx_clothing:ReloadAppearanceData("mp_f_freemode_01")
ReApplyAppearance()export → —

Reapplies the most recently cached appearance without querying the server. Falls back to ReloadAppearanceData() if nothing is cached.

getAppearance(citizenid)export → table

Client-side callback wrapper that fetches another player's appearance by citizenid (used by the QB multicharacter preview flow).

Lua
local appearance = exports.rarx_clothing:getAppearance("ABC12345")
-- appearance = { model, skin, drawables, props, label, hairslots }

Clothing & Props#

GetPedDrawables(ped)export → table

Returns a keyed table of drawable/texture pairs for every clothing category on the ped: { masks = { drawable = 0, texture = 0 }, shirts = { ... }, ... }.

Applies a single drawable (mask, shirt, jacket, etc.) via its hash. If save = true, calls SaveAppearance() after applying so the change persists.

Lua
exports.rarx_clothing:SetPedDrawableByHash(PlayerPedId(), "none--8--42--2", true)

Same as above but for props (hats, glasses, watches, etc.). A prop hash with drawable_id = -1 clears the slot.

Lua
exports.rarx_clothing:SetPedPropByHash(PlayerPedId(), "none--1000--5--0")

Resets a specific category to its model's default "remove" hash (from Config.RemoveItem[pedModel][category]). Useful for "strip" commands.

Lua
exports.rarx_clothing:RemoveClothing(PlayerPedId(), "masks", true)

Returns the default "remove" hash for the given model + category, or nil if none is configured.

Lua
local removeMask = exports.rarx_clothing:GetRemoveHash(GetHashKey("mp_m_freemode_01"), "masks")
openCreation(gender?)export → —

Opens the character creation flow. gender is optional (0 = male, 1 = female); if omitted, uses the player's current framework gender. Forces the correct freemode model, clears components, and puts the player in a routing bucket.

Lua
exports.rarx_clothing:openCreation(0)

Low-level creation entrypoint. Blocks the current thread and returns the final GetAppearanceData table when the player finishes creation.

  • skipInterior (bool) — skip loading the dedicated creation interior
  • gender (0|1) — male or female freemode preset
  • ped (entity) — optional existing ped to edit (skips model load)
  • noTeleport (bool) — don't teleport the ped to Config.SpawnPoint
Lua
local skin = exports["rarx_clothing"]:startPedCreation(true, 0, npcEntity, true)
-- skin = full appearance table, ready to serialize

Opens the outfit menu. isJobMenu = true shows job outfits; isBossOverride lets you force boss (manager) mode on — pass nil to auto-detect from Config.WorkAttire.bossGrade.

Lua
exports.rarx_clothing:openOutfitMenu(true, nil)   -- job menu, auto-detect boss
exports.rarx_clothing:openOutfitMenu(false)       -- personal outfits
getEquippedOutfit(jobOnly?)export → table|nil

Returns the currently equipped outfit object (or nil if none). jobOnly = true only matches job outfits.

Lua
local outfit = exports.rarx_clothing:getEquippedOutfit(true)
if outfit then print("Wearing job outfit: " .. outfit.label) end
ShowControls()export → —

Shows the NUI keybinding hints overlay (bottom of the screen). Use from another resource that needs to reserve keys while its own UI is active.

HideControls()export → —

Hides the NUI keybinding hints overlay.

Server Exports#

Fetches a player's stored appearance from the database by citizenid. Optional model filters to a specific ped model. Returns { model, skin, drawables, props, label, hairslots } or an empty table if nothing is stored.

Lua
local appearance = exports.rarx_clothing:getAppearance(xPlayer.PlayerData.citizenid)
if appearance.skin then
    local skin = json.decode(appearance.skin)
end

Verifies whether a player is allowed to wear a specific item. Returns true if no permission row exists or the player matches an allowed identifier/job/grade.

Lua
local ok = exports.rarx_clothing:checkItemPermissions(src, 1234)
if not ok then return end

Client Events#

Listen — fired by rarx_clothing#

rarx_clothing:saveAppearanceevent → { drawables, props }

Fires whenever SaveAppearance() runs (end of creation, commit clothes, etc.). Use this to sync your own appearance cache.

Lua
AddEventHandler("rarx_clothing:saveAppearance", function(data)
    -- data.drawables, data.props
end)

Trigger — send to rarx_clothing#

Opens the main clothing NUI in a given mode. Valid values: "creation", "clothes", "stock", "barber", "ped", "outfit", "outfitCreator", "admin".

Lua
TriggerEvent("rarx_clothing:openClothingMenu", "barber")

Manually trigger the player-load flow (appearance reload + outfit rehydration). Normally fired automatically on framework load.

Server → Client (listen on your client, fired by rarx_clothing server)#

Event Payload Purpose
rarx_clothing:client:createStore store table A new store was created and should appear in the world.
rarx_clothing:client:updateStore store table A store definition changed (label, coords, categories).
rarx_clothing:client:deleteStore store id A store was removed.
rarx_clothing:client:UpdateOutfit outfit table A personal or job outfit was created/updated.
rarx_clothing:client:RemoveJobOutfit outfit id A job outfit was deleted.
rarx_clothing:client:onJobUpdate — Player's job changed; re-fetch job outfits.
rarx_clothing:client:qbPreview { citizenid, coords } | nil Spawn a preview ped for the QB character selector. Pass nil to clear.
rarx_clothing:client:notify message, type, duration Forwarded notification (shown through Custom.Notify).
rarx_clothing:client:selectHairSlot targetIndex Force-switch the player's active hair slot.

Server Events#

Creates a new outfit row. Required fields: label (string, max 50 chars), model (ped hash or name), drawables (hash table keyed by category), props (hash table keyed by category), jobOutfit (bool). For jobOutfit = true, the player must be admin or a boss (matching Config.WorkAttire.bossGrade[jobName]).

Lua
TriggerServerEvent("rarx_clothing:server:CreateOutfit", {
    label     = "Patrol Uniform",
    model     = GetHashKey("mp_m_freemode_01"),
    drawables = exports.rarx_clothing:GetAppearanceData().drawables,
    props     = exports.rarx_clothing:GetAppearanceData().props,
    jobOutfit = true,
})
rarx_clothing:server:UpdateOutfitClothesevent → { id, label, drawables, props }

Updates an existing outfit's clothing (not its identifier/job). Server verifies ownership before writing.

Usage Examples#

Save a new outfit from outside rarx_clothing#

Lua
-- On the client, after dressing the player ped:
local data = exports.rarx_clothing:GetAppearanceData()
TriggerServerEvent("rarx_clothing:server:CreateOutfit", {
    label     = "Heist Disguise",
    model     = data.model,
    drawables = data.drawables,
    props     = data.props,
    jobOutfit = false,
})

Reproduce another player's look on an NPC#

Lua
-- Server-side
local appearance = exports.rarx_clothing:getAppearance(targetCitizenId)
TriggerClientEvent("yourResource:spawnNpcCopy", -1, appearance)

-- Client-side handler
RegisterNetEvent("yourResource:spawnNpcCopy", function(appearance)
    if not appearance or not appearance.skin then return end
    local skin = json.decode(appearance.skin)
    lib.requestModel(skin.model, 10000)
    local ped = CreatePed(0, skin.model, coords.x, coords.y, coords.z, 0.0, false, false)
    exports.rarx_clothing:SetAppearance(ped, skin, false)
end)

Gate a custom item behind rarx_clothing permissions#

Lua
-- Server-side before allowing a clothing action
local allowed = exports.rarx_clothing:checkItemPermissions(source, itemId)
if not allowed then
    return TriggerClientEvent("ox_lib:notify", source, { type = "error", description = "No tienes acceso a esta prenda." })
end

Troubleshooting#

Store not appearing on map

Verify that Config.ShopTypes has the correct blip configuration and that the store was created through the admin panel.

Photo grid shows blank images

Ensure rarx_clothing_screenshot is started. The screenshot resource generates thumbnails for the photo grid.

Cannot open management panel

Check that your admin role matches one of the entries in Config.Permissions. An empty table means unrestricted access.

Items not saving after purchase

Verify that oxmysql is running and the database tables were imported correctly.

Appearance resets on relog

Run the /fixpj command (or your configured fixSkin command) to reapply stored appearance. Check that your appearance system is saving correctly.

Target interaction not working

If using Config.Access.system = 'auto', ensure either ox_target or qb-target is started. Otherwise, set it explicitly.

Compatibility#

The script provides an illenium-appearance compatibility layer that can be enabled by uncommenting the provide 'illenium-appearance' line in fxmanifest.lua. This allows other resources that depend on illenium-appearance to work with rarx_clothing instead.