Skip to content

Exports, events and hooks

Everything another resource may call. Use exports.cc_illumium:... or, for scripts written against illenium, exports['illenium-appearance']:... (the manifest provides it, so both names reach the same f

Everything another resource may call. Use exports.cc_illumium:... or, for scripts written against illenium, exports['illenium-appearance']:... (the manifest provides it, so both names reach the same functions).

Server exports are trusted (only server code can call them). Client exports can only open menus and change the local ped's preview: a client can never set a price or save a look the server has not checked.

Server exports

ExportArgumentsReturnsWhat it does
getAppearance(src)player idappearance or nilWhat the player wears now, uniform included
getSavedAppearance(identifier)citizenid / ESX identifierappearance or nilThe saved look of any character, online or not
saveAppearance(src, appearance)player id, appearancebooleanSanitise and save a look (the model cannot change), put it on the player
isInMenu(src)player idbooleanWhether the player has a menu open
closeMenu(src)player id-Close the player's menu; the saved look goes back on
allowCreator(src)player idbooleanLet that character run the creator once more
removeUniform(src)player id-Take a uniform overlay off
grantFreeSession(src, kind, opts)player id, 'surgeon' or 'barber', { ttlMs? }boolean, errOne free visit where the player stands (a perk, an item). Their next startPlayerCustomization uses it. One use, expires
registerWardrobe(def){ id, label, coords, heading, owners? }booleanAdd a home closet at runtime (housing). owners = identifiers allowed; nil = anyone. Dropped when your resource stops
unregisterWardrobe(id)idbooleanRemove a closet you registered
getWardrobes()-tableA copy of every registered closet
registerHook(name, fn)hook name, functionidRegister a hook from another resource (see Hooks)
getHooks()-tableEvery hook with its payload description
lua
-- A housing script: one closet per owned house
exports.cc_illumium:registerWardrobe({
    id = 'house_42', label = 'Bedroom closet',
    coords = vector3(-174.3, 497.6, 137.6), heading = 190.0,
    owners = { 'ABC12345' },
})

-- A supporter perk: one free surgeon visit
exports.cc_illumium:grantFreeSession(source, 'surgeon', { ttlMs = 120000 })
TriggerClientEvent('my_perks:openSurgeon', source)   -- your client then calls startPlayerCustomization

Client exports

Our own

ExportArgumentsReturnsWhat it does
openStore(id)store id from Config.StoresbooleanOpen the nearest store of that store's kind (the server checks distance)
openWardrobe(id)wardrobe id or nilbooleanOpen a wardrobe (the server checks who may)
isMenuOpen()-booleanWhether a menu is open
saveOwnedLook()-booleanSave what the ped wears now when every piece is already owned (item outfit bags). Nothing is charged; the server refuses anything not owned

illenium-appearance compatible

Getters (default ped = the player): getPedModel(ped), getPedComponents(ped), getPedProps(ped), getPedHeadBlend(ped), getPedFaceFeatures(ped), getPedHeadOverlays(ped), getPedHair(ped), getPedAppearance(ped).

Setters (preview on the ped, never saved): setPlayerModel(model), setPedHeadBlend(ped, hb), setPedFaceFeatures(ped, ff), setPedHeadOverlays(ped, ho), setPedHair(ped, hair, tattoos), setPedEyeColor(ped, c), setPedComponent(ped, c), setPedComponents(ped, list), setPedProp(ped, p), setPedProps(ped, list), setPedTattoos(ped, t), setPedAppearance(ped, a), setPlayerAppearance(a).

Menus:

ExportBehaviour in cc_illumium
InitializeCharacter(gender, onSubmit, onCancel)The creator (the server decides the character is new)
startPlayerCustomization(cb, config)A creator config (ped = true or enableExit = false) is the creator. Otherwise a granted free visit, else the nearest paid clothing store. Never a free full editor
OpenCatalogLocker(entry)The nearest store of the entry's kind

Events other resources may fire (client)

EventFromResult
illenium-appearance:client:reloadSkinanyoneRe-load the saved look
illenium-appearance:client:openClothingShop / OpenBarberShop / OpenTattooShop / OpenSurgeonShopanyoneNearest store of that kind
illenium-appearance:client:openClothingShopMenuanyoneNearest clothing store (the free ped menu is refused)
illenium-appearance:client:openOutfitMenu, qb-clothing:client:openOutfitMenuanyoneThe wardrobe
illenium-appearance:client:loadJobOutfit, qb-clothing:client:loadOutfitjob lockersWear a uniform as an overlay
qb-clothing:client:openMenuadmin toolsCreator if no saved skin, else nearest paid store
qb-clothes:client:CreateFirstCharacterqb / qbx multicharacterThe creator; answers qb-clothing:client:onMenuClose
esx_skin:openSaveableMenu(submit, cancel)ESX multicharacter / identityThe creator (Config.Compat.esxSkin)
esx_skin:openMenu(submit, cancel)ESX scriptsCreator if no saved skin, else nearest paid store
skinchanger:loadSkin(skin, cb)ESXRe-load the saved look (the passed skin is ignored)
skinchanger:loadDefaultModel(isMale, cb)ESXA bare freemode body
skinchanger:loadClothes(skin, clothes)ESX job lockersWear the clothes as an overlay
skinchanger:getSkin(cb)ESXcb(appearance) with sex 0 / 1 added

Events we fire

EventSideArgumentsWhen
cc_illumium:client:creatorFinishedclient (local)-The creator saved
qb-clothing:client:onMenuCloseclient (local)-The creator closed (qb multicharacter waits for it)
cc_illumium:server:creatorFinishedserver (local)src, identifier, appearanceA new character's look was saved
cc_illumium:server:freeSessionUsedserver (local)src, kind, grantedBy, appearanceA granted free visit was used
cc_illumium:server:storeChangedserver (local)storeId, whyA player-owned store changed hands or state

Server-local events can only be fired by server code, so they are safe to trust.

Hooks

Register from custom/server.lua with CC.hooks.register(name, fn), or from another resource with exports.cc_illumium:registerHook(name, fn). Hooks narrow: what a hook hands back is re-checked (a price is clamped to 0..Prices.maxTotal, a look is sanitised again). A hook that errors is logged and ignored.

HookCancel (return false)MutablePayload
beforePurchaserefuses the checkoutpricesource, kind, store, lines, price, quote (quote = true while only pricing, so the receipt shows your change)
afterPurchase--source, kind, store, lines, price, account, appearance
outfitAccessblocks it-source, action (list wear share airdrop import), outfitId, group
appearanceFilter-appearancesource, kind, appearance (sanitised again after you)

Examples (VIP discount, closed parlours, uniform rules, forced decals) are in custom/server.lua, commented out.

custom/client.lua

FunctionReturnUse
CustomClient.canOpen(kind, storeId)booleanfalse stops a menu opening
CustomClient.isDowned()booleanTell cc_illumium your death system downed the player
CustomClient.onOpened(kind, storeId)-Hide your HUD
CustomClient.onClosed(kind, storeId, committed)-Show it again

The appearance object

illenium's shape, unchanged: model, components[] (component_id, drawable, texture), props[] (prop_id, drawable, texture; -1 = none), headBlend, faceFeatures, headOverlays, hair (style, texture, color, highlight), eyeColor, tattoos (per zone).