SHOPPING CART

Onex

Command Palette

Search for a command to run...

QBCORE INTEGRATION#

onex-creation provides full QBCore compatibility, replacing qb-clothing with enhanced features while maintaining all existing events and exports.

Overview#

When using QBCore, onex-creation:

  • Handles all qb-clothing events
  • Uses QBCore's money system for purchases
  • Integrates with QBCore's player data for appearance storage

Requirements#

Ensure these QBCore resources are running:

server.cfg
ensure qb-core ensure ox_lib ensure onex-base ensure onex-interaction ensure onex-creation

Remove or comment out qb-clothing from your server.cfg. onex-creation replaces it completely.

Framework Detection#

Framework is automatically detected. No manual configuration needed:

modules/framework/shared/framework.lua
-- Auto-detection via GlobalState -- GlobalState.xframework = 'qb' (set by onex-base)

Replaced Events#

onex-creation handles these qb-clothing events:

EventDescription
qb-clothes:client:CreateFirstCharacterNew character creation
qb-clothing:client:loadPlayerClothingLoad saved appearance
qb-clothing:client:openMenuOpen clothing menu

CreateFirstCharacter#

Your Script
-- Triggers new character creation TriggerEvent('qb-clothes:client:CreateFirstCharacter') -- Or use onex-creation directly TriggerEvent('onex-creation:client:CreateNewChar')

Load Player Clothing#

Your Script
-- Load saved appearance TriggerEvent('qb-clothing:client:loadPlayerClothing', skin) -- Or use onex-creation directly TriggerEvent('onex-creation:client:loadPedSkin', skin)

Open Menu#

Your Script
-- Open clothing menu TriggerEvent('qb-clothing:client:openMenu') -- Or use onex-creation with type exports['onex-creation']:openCreationMenu('clothes')

Character Creation Integration#

Multi-Character Support#

Works with qb-multicharacter:

qb-multicharacter/client/main.lua
-- When creating new character, call: TriggerEvent('qb-clothes:client:CreateFirstCharacter') -- onex-creation handles this event

Spawn Integration#

Works with qb-spawn or similar:

Spawn Script
RegisterNetEvent('qb-spawn:client:spawned', function() -- Load player appearance local skin = QBCore.Functions.GetPlayerData().charinfo.skin if skin then TriggerEvent('qb-clothing:client:loadPlayerClothing', skin) end end)

Job Outfits#

Configure job outfits for QBCore jobs:

config/shop.lua
Shop.JobOutfits = { ["police"] = { label = "Los Santos Police Department", outfits = { { label = "Patrol Officer", minGrade = 0, -- QBCore job grade outfit = { torso = { collection = "base", localIndex = 55, texture = 0 }, pants = { collection = "base", localIndex = 25, texture = 0 }, shoes = { collection = "base", localIndex = 10, texture = 0 } } }, { label = "Sergeant", minGrade = 3, outfit = { ... } } } }, ["ambulance"] = { label = "Los Santos EMS", outfits = { { label = "EMT", minGrade = 0, outfit = { ... } } } } }

Job grades are checked against QBCore's job system. Players can only access outfits at or below their grade.

Using Exports#

All exports work the same regardless of framework:

Your Script
-- Open creation menu exports['onex-creation']:openCreationMenu('clothes') -- Get current appearance local appearance = exports['onex-creation']:FetchPlayerClothes() -- Load skin on ped exports['onex-creation']:LoadPedSkin(appearance, PlayerPedId()) -- Load custom outfit(job uniform) exports['onex-creation']:loadCustomOutfit(outfit, true) -- true = persist

Notifications#

Configure notification system:

modules/framework/shared/framework.lua
Framework.Notify = { name = 'onex-interaction' -- or 'qb-notify' }
OptionDescription
'onex-interaction'Uses onex-interaction notifications
'qb-notify'Uses QBCore's built-in notifications

Common QBCore Integrations#

qb-inventory#

Your Script
-- When giving clothing item from inventory RegisterNetEvent('qb-inventory:client:ItemBox', function(itemData, type) if itemData.name == 'outfit_item' then local outfit = json.decode(itemData.info.outfit) exports['onex-creation']:loadCustomOutfit(outfit, false) end end)

qb-target#

Shop zones work with qb-target if onex-interaction is not preferred:

Your Script
exports['qb-target']:AddBoxZone("clothing_shop", vector3(72.25, -1399.10, 29.37), 2.0, 2.0, { name = "clothing_shop", heading = 0, minZ = 28.37, maxZ = 31.37 }, { options = { { type = "client", event = "onex-creation:client:openCreationMenu", icon = "fas fa-tshirt", label = "Open Clothing Store", shopType = "clothes" } }, distance = 2.0 })

Next Steps#