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#
# server.cfg
# ensure qbx_multicharacter <-- Comment out or remove
ensure 0r-multicharacterv3
Step 2: Start Order#
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:
| Column | Usage |
|---|---|
| citizenid | Unique character identifier |
| cid | Character slot number |
| license | Player identifier (license2) |
| charinfo | Character information (JSON) |
| job | Job data (JSON) |
| money | Money data (JSON) |
| position | Last position (JSON) |
QBox uses license2 instead of license for player identification.
π§ Framework Functions#
The script uses QBox exports:
-- 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:
Config.SpawnSelector = 'qbx_spawn'
This triggers:
TriggerClientEvent('qb-spawn:client:setupSpawns', playerId)
β‘ Events#
Server Events#
QBox uses the same events as QBCore:
-- 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:
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#
-- 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#
| Feature | QBCore | QBox |
|---|---|---|
| Player ID | license | license2 |
| Exports | qb-core | qbx_core |
| Spawn | qb-spawn | qbx_spawn |
| Modern Lua | No | Yes |
β Troubleshooting#
"Player not found" error#
QBox uses license2:
- Verify player has Steam/license2
- 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:OnPlayerLoadedQBCore:Client:OnPlayerLoaded