Docs/ORB Multicharacter/Events & Exports

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.

CallbackPurposeReturns
orb-multicharacter:server:getCharactersList the player's characters{ characters, slots, lastCitizenid }
orb-multicharacter:server:createCharacterCreate a character (name sanitised, slots re-checked){ ok, citizenid } or { ok = false, reason }
orb-multicharacter:server:selectCharacterLog in and spawn (refused if already spawned){ ok, standalone, model, appearance, coords }
orb-multicharacter:server:getCharacterVehiclesOwned vehicles for one or many characters{ vehicles } or { byChar }
orb-multicharacter:server:deleteCharacterDelete a character (respects EnableDelete)boolean

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 a dependency 'qb-multicharacter' resolves against ORB Multicharacter
  • Character creation is handed off to the detected clothing system — with orb-clothing the resource waits for orb-clothing:client:characterCreationComplete, and with qb-clothing for qb-clothing:client:finishCharacterCreation