
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#
Configurable store locations with per-category pricing, multiple payment methods, and blip markers
Visual item browsing with rendered thumbnails instead of numeric selectors
Save, load, and manage outfits per character with quick-equip support
Full face, hair, makeup, and body customization with bone-relative camera zones
Add multiple items to cart and purchase them all at once with bank or cash
Create and manage stores, import stock, configure global items and per-store inventory
Faction-specific outfit stations where bosses can manage work attire for their employees
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#
Download & Extract
Download the latest version from your Keymaster and extract it to your server's resources folder.
Import Database
Import the included SQL file to create the required tables for stores, stock, and outfits.
Add to server.cfg
ensure rarx_clothingMake sure
ox_lib,oxmysql, andrarx_libare started before this resource.Optional: Photo Grid Screenshots
If you want the photo grid feature, also start the screenshot helper:
ensure rarx_clothing_screenshotConfigure
Edit
config/_general.luato 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#
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 = trueCommands#
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#
-- Roles that can access the management panel (empty = unrestricted)
Config.Permissions = {
'god',
'superadmin',
'admin',
}Payment & Pricing#
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#
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#
Config.Indicator = {
enabled = true,
renderDistance = 30,
presets = {
clothes = 'clothing',
barber = 'barber',
masks = 'clothing',
},
}Store Types & Blips#
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#
-- 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#
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#
- Run the management command (default:
/clothing) - Use the Store Wizard to create a new store
- Set the store name, type (clothes, barber, masks), and location
- Configure which categories are available in the store
- 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:
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 → tableReturns the full appearance of a ped: { model, headBlendData, faceFeatures, headOverlays, hairTint, eyeColor, drawables, props, pedScale }. If ped is nil, defaults to PlayerPedId().
local skin = exports.rarx_clothing:GetAppearanceData()
-- or for another entity
local npcSkin = exports.rarx_clothing:GetAppearanceData(npcEntity)SetAppearance(ped, data, skipModelLoad?)export → —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.
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.
ReloadAppearanceData(model?)export → —Fetches the player's saved appearance from the server and applies it. Optional model string forces a specific ped model before applying.
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 → tableClient-side callback wrapper that fetches another player's appearance by citizenid (used by the QB multicharacter preview flow).
local appearance = exports.rarx_clothing:getAppearance("ABC12345")
-- appearance = { model, skin, drawables, props, label, hairslots }Clothing & Props#
GetPedDrawables(ped)export → tableReturns a keyed table of drawable/texture pairs for every clothing category on the ped: { masks = { drawable = 0, texture = 0 }, shirts = { ... }, ... }.
SetPedDrawableByHash(ped, hash, save?)export → —Applies a single drawable (mask, shirt, jacket, etc.) via its hash. If save = true, calls SaveAppearance() after applying so the change persists.
exports.rarx_clothing:SetPedDrawableByHash(PlayerPedId(), "none--8--42--2", true)SetPedPropByHash(ped, hash, save?)export → —Same as above but for props (hats, glasses, watches, etc.). A prop hash with drawable_id = -1 clears the slot.
exports.rarx_clothing:SetPedPropByHash(PlayerPedId(), "none--1000--5--0")RemoveClothing(ped, category, save?)export → —Resets a specific category to its model's default "remove" hash (from Config.RemoveItem[pedModel][category]). Useful for "strip" commands.
exports.rarx_clothing:RemoveClothing(PlayerPedId(), "masks", true)GetRemoveHash(pedModelHash, category)export → string|nilReturns the default "remove" hash for the given model + category, or nil if none is configured.
local removeMask = exports.rarx_clothing:GetRemoveHash(GetHashKey("mp_m_freemode_01"), "masks")Menus & Creation#
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.
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 interiorgender(0|1) — male or female freemode presetped(entity) — optional existing ped to edit (skips model load)noTeleport(bool) — don't teleport the ped toConfig.SpawnPoint
local skin = exports["rarx_clothing"]:startPedCreation(true, 0, npcEntity, true)
-- skin = full appearance table, ready to serializegetEquippedOutfit(jobOnly?)export → table|nilReturns the currently equipped outfit object (or nil if none). jobOnly = true only matches job outfits.
local outfit = exports.rarx_clothing:getEquippedOutfit(true)
if outfit then print("Wearing job outfit: " .. outfit.label) endShowControls()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#
getAppearance(citizenid, model?)export → tableFetches 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.
local appearance = exports.rarx_clothing:getAppearance(xPlayer.PlayerData.citizenid)
if appearance.skin then
local skin = json.decode(appearance.skin)
endcheckItemPermissions(source, itemId)export → boolVerifies 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.
local ok = exports.rarx_clothing:checkItemPermissions(src, 1234)
if not ok then return endClient 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.
AddEventHandler("rarx_clothing:saveAppearance", function(data)
-- data.drawables, data.props
end)Trigger — send to rarx_clothing#
rarx_clothing:client:onPlayerLoadevent → —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#
rarx_clothing:server:CreateOutfitevent → outfitDataCreates 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]).
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#
-- 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#
-- 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#
-- 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." })
endTroubleshooting#
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.
