Exports & API
Complete API reference for Oxide Clothing with events, callbacks, and module functions.
Server Events
Save Appearance
Save a player's complete appearance:
TriggerServerEvent('oxide-clothing:server:SaveAppearance', {
model = 'mp_m_freemode_01',
face = {
headBlend = { shapeFirst = 0, shapeSecond = 21, shapeMix = 0.5, skinFirst = 0, skinSecond = 21, skinMix = 0.5 },
features = { [0] = 0.0, [1] = 0.0, ... },
overlays = { [0] = { style = 0, opacity = 1.0, color = 0 }, ... },
},
hair = { style = 0, color = 0, highlight = 0 },
clothing = {
components = { [0] = { drawable = 0, texture = 0 }, ... },
props = { [0] = { drawable = -1, texture = 0 }, ... },
},
})
Load Appearance
Request a player's appearance from database:
TriggerServerEvent('oxide-clothing:server:LoadAppearance')
Response sent to client via oxide-clothing:client:LoadAppearance.
Save Outfit
Save current clothing as an outfit:
TriggerServerEvent('oxide-clothing:server:SaveOutfit', outfitName, components, props)
Delete Outfit
Delete a saved outfit:
TriggerServerEvent('oxide-clothing:server:DeleteOutfit', outfitId)
Client Events
Load Appearance Response
Received after requesting appearance load:
RegisterNetEvent('oxide-clothing:client:LoadAppearance', function(isNewCharacter, data)
if isNewCharacter then
-- Open character creator
else
-- data contains: { model, face, hair, eyeColor, clothing }
end
end)
Save Complete
Confirmation after saving appearance:
RegisterNetEvent('oxide-clothing:client:SaveComplete', function(success)
if success then
-- Appearance saved successfully
end
end)
Refresh Outfits
Outfit list updated:
RegisterNetEvent('oxide-clothing:client:RefreshOutfits', function(outfits)
-- outfits = { { id, name, components, props }, ... }
end)
Server Callbacks
Get Outfits
Retrieve all outfits for the current player:
QBCore.Functions.TriggerCallback('oxide-clothing:server:GetOutfits', function(outfits)
-- outfits = { { id, name, components, props, createdAt }, ... }
end)
Backward Compatible Events
These events are aliased to the new system for compatibility:
qb-clothing Events
-- Save skin (old format)
TriggerServerEvent('qb-clothing:saveSkin', model, skinData)
-- Load player skin
TriggerServerEvent('qb-clothing:loadPlayerSkin')
-- Save outfit (old format)
TriggerServerEvent('qb-clothing:saveOutfit', outfitName, model, skinData)
-- Remove outfit
TriggerServerEvent('qb-clothing:server:removeOutfit', outfitName, outfitId)
-- Get outfits callback
QBCore.Functions.TriggerCallback('qb-clothing:server:getOutfits', function(outfits) end)
qb-clothes Events
-- Load player skin (alternative naming)
TriggerServerEvent('qb-clothes:loadPlayerSkin')
-- Save outfit (alternative naming)
TriggerServerEvent('qb-clothes:saveOutfit', outfitName, model, skinData)
Data Structures
HeadBlend
{
shapeFirst = 0, -- Father face shape (0-45)
shapeSecond = 21, -- Mother face shape (0-45)
shapeMix = 0.5, -- Face blend (0.0-1.0)
skinFirst = 0, -- Father skin tone (0-45)
skinSecond = 21, -- Mother skin tone (0-45)
skinMix = 0.5, -- Skin blend (0.0-1.0)
}
Features
{
[0] = 0.0, -- Nose Width (-1.0 to 1.0)
[1] = 0.0, -- Nose Peak Height
-- ... indices 0-19
}
Overlays
{
[0] = { -- Blemishes
style = 0, -- Variation (0 = none)
opacity = 1.0, -- Visibility (0.0-1.0)
color = 0, -- Primary color
secondColor = 0, -- Secondary color
},
-- ... indices 0-12
}
Hair
{
style = 0, -- Hair variation
color = 0, -- Primary color (0-63)
highlight = 0, -- Highlight color (0-63)
}
Clothing
{
components = {
[0] = { drawable = 0, texture = 0 }, -- Face
[1] = { drawable = 0, texture = 0 }, -- Mask
-- ... indices 0-11
},
props = {
[0] = { drawable = -1, texture = 0 }, -- Hat (-1 = none)
[1] = { drawable = -1, texture = 0 }, -- Glasses
[2] = { drawable = -1, texture = 0 }, -- Ear
[6] = { drawable = -1, texture = 0 }, -- Watch
[7] = { drawable = -1, texture = 0 }, -- Bracelet
},
}
Client Module Functions
The Ped module is available globally on the client:
-- Apply appearance
Ped.ApplyHeadBlend(ped, headBlend)
Ped.ApplyFeatures(ped, features)
Ped.ApplyOverlays(ped, overlays)
Ped.ApplyHair(ped, hair)
Ped.ApplyEyeColor(ped, eyeColor)
Ped.ApplyClothing(ped, clothing)
Ped.ApplyAppearance(ped, appearance) -- All at once
-- Set individual items
Ped.SetComponent(ped, componentId, drawable, texture)
Ped.SetProp(ped, propId, drawable, texture)
-- Get current values
Ped.GetClothing(ped) -- Returns { components, props }
Ped.GetMaxDrawable(ped, componentId)
Ped.GetMaxTexture(ped, componentId, drawable)
Ped.GetMaxPropDrawable(ped, propId)
Ped.GetMaxPropTexture(ped, propId, drawable)
Ped.GetMaxHairStyle(ped)
Ped.GetMaxOverlay(ped, overlayId)
-- Model management
Ped.LoadModel(model)
Ped.SetModel(ped, model)
Server Module Functions
Available globally on the server:
Appearance
Appearance.Get(citizenid)
Appearance.Save(citizenid, face, hair, model, eyeColor)
Appearance.UpdateFace(citizenid, face)
Appearance.UpdateHair(citizenid, hair)
Appearance.UpdateModel(citizenid, model)
Appearance.Delete(citizenid)
Appearance.Exists(citizenid)
Clothing
Clothing.Get(citizenid)
Clothing.Save(citizenid, components, props)
Clothing.UpdateComponents(citizenid, components)
Clothing.UpdateProps(citizenid, props)
Clothing.Delete(citizenid)
Clothing.Exists(citizenid)
Outfits
Outfits.GetAll(citizenid)
Outfits.Get(citizenid, outfitId)
Outfits.Save(citizenid, name, components, props)
Outfits.Update(citizenid, outfitId, name, components, props)
Outfits.Delete(citizenid, outfitId)
Outfits.DeleteAll(citizenid)
Outfits.Exists(citizenid, outfitId)
Outfits.Count(citizenid)