Skip to content

QBox Setup

Complete guide for setting up 0r-multicharacterv3 with QBox (qbx_core) framework.

Complete guide for setting up 0r-multicharacterv3 with QBox (qbx_core) framework.

βœ… Requirements#

  • qbx_core (latest version)
  • ox_lib
  • oxmysql
  • A compatible inventory (ox_inventory recommended)
  • A compatible clothing script

πŸš€ Quick Setup#

QBox is designed to work seamlessly with modern resources. Setup is minimal.

Step 1: Disable Default Multicharacter#

cfg
# server.cfg
# ensure qbx_multicharacter  <-- Comment out or remove
ensure 0r-multicharacterv3

Step 2: Start Order#

cfg
ensure oxmysql
ensure ox_lib
ensure qbx_core
ensure ox_inventory
ensure bl_appearance
ensure 0r-multicharacterv3

πŸ—„οΈ Database#

QBox uses the same players table structure as QBCore:

ColumnUsage
citizenidUnique character identifier
cidCharacter slot number
licensePlayer identifier (license2)
charinfoCharacter information (JSON)
jobJob data (JSON)
moneyMoney data (JSON)
positionLast position (JSON)

QBox uses license2 instead of license for player identification.


πŸ”§ Framework Functions#

The script uses QBox exports:

lua
-- Login
exports.qbx_core:Login(source, citizenid, newData)

-- Get Player
exports.qbx_core:GetPlayer(source)

-- Logout
exports.qbx_core:Logout(source)

🏠 Spawn Integration#

qbx_spawn#

If using qbx_spawn:

lua
Config.SpawnSelector = 'qbx_spawn'

This triggers:

lua
TriggerClientEvent('qb-spawn:client:setupSpawns', playerId)

⚑ Events#

Server Events#

QBox uses the same events as QBCore:

lua
-- When player loads character
AddEventHandler('QBCore:Server:PlayerLoaded', function(Player)
    -- Works with QBox
end)

-- When player unloads
AddEventHandler('QBCore:Server:OnPlayerUnload', function(src)
    -- Works with QBox
end)

πŸ”„ Character Deletion#

Configure in config/database.lua:

lua
Database.List = {
    ['qbx_core'] = {
        { table = 'players', column = 'citizenid', type = 'citizenid' },
        { table = 'playerskins', column = 'citizenid', type = 'citizenid' },
        { table = 'player_vehicles', column = 'citizenid', type = 'citizenid' },
        -- Add more tables as needed
    }
}

πŸ“‹ Complete Configuration#

lua
-- config/config.lua for QBox

Config.Debug = false
Config.DeveloperMode = false
Config.Locale = 'en'
Config.HideRadar = true
Config.DefaultCharacterSlots = 2
Config.SkipWarning = false
Config.DisableDeleteCharacter = false

-- Use built-in spawn or qbx_spawn
Config.SkipSpawnSelector = false
Config.SpawnSelector = 'qbx_spawn'  -- or '0r-spawn'
Config.ApartmentStart = false

πŸ†š QBCore vs QBox Differences#

FeatureQBCoreQBox
Player IDlicenselicense2
Exportsqb-coreqbx_core
Spawnqb-spawnqbx_spawn
Modern LuaNoYes

❓ Troubleshooting#

"Player not found" error#

QBox uses license2:

  1. Verify player has Steam/license2
  2. Check database for correct identifier

Commands not refreshing#

QBox handles commands differently. The RefreshCommand function is empty for QBox as it's not needed.

Compatibility with QBCore resources#

Many QBCore resources work with QBox. The script triggers the same events:

  • QBCore:Server:OnPlayerLoaded
  • QBCore:Client:OnPlayerLoaded