Skip to content

mi-appearance

mi-appearance is a character appearance editor, drop-in export-compatible with illenium-appearance. It provides the customization NUI plus clothing, barber, tattoo, and plastic-surgeon shops, saved outfits, job and gang uniforms, and the HalfPed head/hands/pants module.

Install

ensure mi-appearance

Dependencies (ox_lib, oxmysql, qbx_core, ox_target) are standard. It ships server/migrate.lua, so its tables auto-create on first boot, no manual SQL import. It registers the illenium-appearance export names, so resources that call exports['illenium-appearance']:* keep working.

Config

Main knobs (shared/config/init.lua):

Config.MaxOutfits         = 30
Config.ReloadSkinCooldown = 5000          -- ms between /reloadskin uses
Config.AdminGroup         = 'group.admin' -- admin commands and migrations
Config.PedMenuGroup       = 'group.admin' -- /pedmenu, /addped

-- Plastic surgeon payment.
Config.Surgeon = { payment = 'money', item = 'surgery_ticket' } -- 'money' | 'item'

-- How a player opens a shop (clothing / barber / tattoo / surgeon).
Config.Interaction = {
    method        = 'target', -- 'target' | 'sphere' | 'radial'
    radius        = 2.0,
    spawnDistance = 25.0,     -- the shop NPC only spawns within this many metres
    key           = 38,       -- 'sphere' only (38 = E)
    keyLabel      = 'E',
}

-- Job / gang uniforms.
Config.EnableJobOutfitsCommand = true
Config.PersistUniforms         = true  -- keep the last worn uniform across relogs
Config.BossManagedOutfits      = false -- bosses manage uniforms in-game (/bossmanagedoutfits)

Prices, charged server-side on save and only for the categories a player actually changed (shared/config/init.lua):

Config.Prices = {
    clothing = { top = 60, undershirt = 30, pants = 40, shoes = 30, mask = 25,
                 hands = 25, bag = 25, accessory = 20, armor = 50, decal = 15 },
    props    = { hat = 30, glasses = 20, earrings = 15, watch = 25, bracelet = 20 },
    barber   = { hair = 40, beard = 25, eyebrows = 20, eyeColor = 15,
                 makeUp = 15, blush = 10, lipstick = 10 },
    tattoo   = 100,  -- per tattoo applied
    surgeon  = 5000, -- flat fee if face structure or genetics changed
}

HalfPed command names and Discord (shared/config/halfped.lua):

return {
    Commands = {
        GiveHead = 'half', ResetHead = 'resethead', ManageHead = 'managehead',
        AdminHand = 'adminhands', AdminPants = 'adminpants',
        PlayerHand = 'sethand', PlayerPants = 'setpants',
    },
    Discord = { Enabled = false, Webhook = '', BotName = 'HalfPed Logs', Footer = 'mi-appearance HalfPed' },
}

Shop peds and locations, the donation blacklist, the tattoo catalogue, and static uniform sets live in shops.lua, blacklist.lua, tattoos.lua, and outfits.lua.

Exports

Client-side, mirroring the illenium-appearance names (drop-in). Main entry points:

Export Signature What it does
startPlayerCustomization startPlayerCustomization(cb, sessionConfig) Open the customization editor; cb fires when the player finishes
setPlayerAppearance setPlayerAppearance(appearance) Apply a full saved appearance to the local player (restores health and armour around a model swap)
setPedAppearance setPedAppearance(ped, appearance) Apply an appearance to any ped
getPedAppearance getPedAppearance(ped) Read a ped's full appearance table
setPlayerModel / addPedModel (model) Set the local player's ped model

The full illenium getter/setter family is also present: getPedModel/Components/Props/HeadBlend/FaceFeatures/HeadOverlays/Hair and setPedHeadBlend/FaceFeatures/HeadOverlays/Hair/EyeColor/Component(s)/Prop(s)/Tattoos.

Commands

Command Access Does
/pedmenu [id] group.admin (Config.PedMenuGroup) Open the appearance editor on a player
/addped [id] [model] group.admin Set a player to a specific ped model
/joboutfits everyone Open your job uniforms
/gangoutfits everyone Open your gang uniforms
/bossmanagedoutfits everyone (boss) Manage job/gang uniforms (only when Config.BossManagedOutfits)
/reloadskin everyone Reapply your saved appearance
/clearstuckprops everyone Clear stuck attached props
/half [id] [head] [name] everyone HalfPed: apply a saved head/face to a player
/resethead everyone HalfPed: reset your head/face (60s cooldown)
/managehead everyone HalfPed: open head management
/adminhands [id] [drawable] [texture] admin HalfPed: set a player's hands
/adminpants [id] [drawable] [texture] admin HalfPed: set a player's pants
/sethand everyone HalfPed: reapply your hands
/setpants everyone HalfPed: reapply your pants

HalfPed command names are configurable in shared/config/halfped.lua.

Statebags

mi-appearance publishes one player statebag so the server and other resources can tell a player is inside an appearance shop.

Statebag Scope Set when Read by
miShop player Set to the shop type (clothing, barber, tattoo, or surgeon) when the player enters a shop, cleared to nil on leave. The server sets it, it is not trusted from the client. mi-appearance server (prices a save by the shop the player is in); any resource wanting to know a player is customizing

See the state reference for the core statebags and GlobalState.