Events & Exports
Server Exports
lua
-- Which character a player is currently in (returns the citizenid, or nil)
exports['orb-multicharacter']:GetActiveCharacter(source)
-- Log a player out to the character selector (unloads and saves, then reopens the UI)
exports['orb-multicharacter']:Logout(source)The `Logout` export is server-only and therefore unrestricted — it is not reachable from a client, so legitimate integrations keep working even with `LogoutAdminOnly = true`.
Server Events
lua
-- Request a logout from another resource (qb-houses, admin menus, custom /logout).
-- This is a NET event: it enforces the same admin-only ACE rule as the command.
TriggerServerEvent('orb-multicharacter:server:requestLogout')Client Events
lua
-- Fired by the server after a logout - reopens the character selector.
RegisterNetEvent('orb-multicharacter:client:relog', function()
-- handled internally
end)
-- Compatibility: resources that fire the stock qb-multicharacter event are routed
-- through a proper server-side logout first, so the character is unloaded correctly.
TriggerEvent('qb-multicharacter:client:chooseChar')
-- Standalone only: fired once the selected character has been loaded in.
AddEventHandler('orb-multicharacter:client:standaloneLoaded', function()
-- your standalone integration
end)Server Callbacks (ox_lib)
All client to server communication uses lib.callback. Every callback validates the source and re-checks ownership.
Rejection reasons returned by createCharacter and selectCharacter: invalid_name, slots_full, not_owned, already_spawned.
Routing Buckets
lua
-- Isolate the player while the selector is open
TriggerServerEvent('orb-multicharacter:server:enterBucket')
-- Return them to bucket 0
TriggerServerEvent('orb-multicharacter:server:exitBucket')Buckets are released automatically on player disconnect and on resource stop.
Compatibility Notes
- The manifest declares
provides { 'qb-multicharacter' }, so any resource with adependency 'qb-multicharacter'resolves against ORB Multicharacter - Character creation is handed off to the detected clothing system — with
orb-clothingthe resource waits fororb-clothing:client:characterCreationComplete, and withqb-clothingforqb-clothing:client:finishCharacterCreation