### Start Player Customization Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt Opens the character customization interface. It accepts a callback function to handle the result and a configuration table to toggle specific editing features like ped models, clothing, and tattoos. ```Lua exports['illenium-appearance']:startPlayerCustomization(function(appearance) if appearance then print("Appearance saved:", json.encode(appearance)) else print("Customization cancelled") end end, { ped = true, headBlend = true, faceFeatures = true, headOverlays = true, components = true, props = true, tattoos = true, enableExit = true }) ``` -------------------------------- ### Initialize Database Schema for Player Data Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt SQL definitions for storing player skins, saved outfits, and management-level job outfits. These tables ensure character appearance and clothing data persist across server restarts. ```sql CREATE TABLE IF NOT EXISTS `playerskins` ( `id` int(11) NOT NULL AUTO_INCREMENT, `citizenid` varchar(255) NOT NULL, `model` varchar(255) NOT NULL, `skin` text NOT NULL, `active` tinyint(4) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `citizenid` (`citizenid`), KEY `active` (`active`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `player_outfits` ( `id` int(11) NOT NULL AUTO_INCREMENT, `citizenid` varchar(255) NOT NULL, `outfitname` varchar(255) NOT NULL, `model` varchar(255) DEFAULT NULL, `components` text DEFAULT NULL, `props` text DEFAULT NULL, PRIMARY KEY (`id`), KEY `citizenid` (`citizenid`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `management_outfits` ( `id` int(11) NOT NULL AUTO_INCREMENT, `type` varchar(50) NOT NULL, `job` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `gender` varchar(50) NOT NULL, `model` varchar(255) DEFAULT NULL, `components` text DEFAULT NULL, `props` text DEFAULT NULL, `minrank` int(11) DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; ``` -------------------------------- ### Configure Shop Locations and Zones (Lua) Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt This Lua snippet defines the configuration for various shop locations within the game. It includes details such as the shop type, coordinates, size, rotation, and whether to use polygon zones. Optional parameters for target models and scenarios are also supported. This configuration is crucial for defining interactable shop areas. ```lua Config.Stores = { { type = "clothing", -- clothing, barber, tattoo, surgeon coords = vector4(1693.2, 4828.11, 42.07, 188.66), size = vector3(4, 4, 4), rotation = 45, usePoly = false, -- Use polyzone points instead of box showBlip = true, -- Optional overrides targetModel = "s_f_m_shop_high", targetScenario = "WORLD_HUMAN_STAND_MOBILE", points = { -- For polyzone vector3(1686.90, 4829.83, 42.07), vector3(1698.85, 4831.46, 42.07), vector3(1700.24, 4817.77, 42.07), vector3(1688.36, 4816.29, 42.07) } } } ``` -------------------------------- ### Open Clothing Shop Menu (Lua) Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt Triggers the client-side event to open the main clothing store menu. The boolean argument determines if it should be opened as an admin/ped menu, bypassing payment. ```lua -- Open clothing shop menu for the player TriggerEvent("illenium-appearance:client:openClothingShopMenu", false) -- Open as admin/ped menu (bypasses payment) TriggerEvent("illenium-appearance:client:openClothingShopMenu", true) ``` -------------------------------- ### Share Outfit Codes Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt Allows generating a shareable string code for an outfit and importing an outfit using such a code. Useful for sharing character styles between players. ```Lua -- Generate code lib.callback("illenium-appearance:server:generateOutfitCode", false, function(code) if code then print("Outfit code: " .. code) end end, outfitId) -- Import code lib.callback("illenium-appearance:server:importOutfitCode", false, function(success) if success then print("Imported successfully!") end end, "Outfit Name", "ABC123XYZ") ``` -------------------------------- ### Check Player Money for Shop Services (Lua) Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt This Lua snippet checks if a player has sufficient funds for shop services by calling a server-side callback. It handles both successful and unsuccessful purchase scenarios, providing feedback to the player. The function requires a service type string (e.g., 'clothing', 'barber') as an argument. ```lua lib.callback("illenium-appearance:server:hasMoney", false, function(hasMoney, requiredAmount) if hasMoney then -- Open shop else print("Need $" .. requiredAmount .. " to enter") end end, "clothing") -- clothing, barber, tattoo, or surgeon ``` -------------------------------- ### Open Job Outfits Menu (Lua) Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt Opens a menu displaying available job/gang outfits for the player. Requires an array of outfit objects, each containing name, jobName, outfitData, and optionally gender and grades. ```lua -- Open job outfits menu with specific outfits local outfitsToShow = { { name = "Patrol Uniform", jobName = "police", gender = "Male", outfitData = { ["pants"] = { item = 24, texture = 0 }, ["torso2"] = { item = 55, texture = 0 }, ["shoes"] = { item = 51, texture = 0 } } } } TriggerEvent("illenium-appearance:client:openJobOutfitsMenu", outfitsToShow) ``` -------------------------------- ### Configure Job/Gang Specific Clothing Rooms (Lua) Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt This Lua snippet configures specific clothing room locations tied to jobs or gangs. It specifies the job/gang affiliation, coordinates, dimensions, and rotation of the room. Similar to stores, it supports using polygon zones and provides points for defining these zones. This allows for role-specific customization of player appearance. ```lua Config.ClothingRooms = { { job = "police", -- or gang = "ballas" coords = vector4(454.91, -990.89, 30.69, 193.4), size = vector3(4, 4, 4), rotation = 45, usePoly = false, points = { vector3(460.41, -993.11, 30.69), vector3(449.39, -993.60, 30.69), vector3(449.88, -990.23, 30.69), vector3(460.42, -987.94, 30.69) } } } ``` -------------------------------- ### Retrieve Appearance and Outfits via Callbacks Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt Uses server callbacks to fetch appearance data, saved outfits, or job/gang-specific managed outfits. These are asynchronous operations that return data to the client once retrieved from the database. ```Lua -- Get appearance lib.callback("illenium-appearance:server:getAppearance", false, function(appearance) if appearance then exports['illenium-appearance']:setPlayerAppearance(appearance) end end) -- Get outfits lib.callback("illenium-appearance:server:getOutfits", false, function(outfits) for i = 1, #outfits do print(outfits[i].name) end end) ``` -------------------------------- ### Define Job/Gang Outfits by Grade (Lua) Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt This Lua snippet defines a structured list of outfits available for specific jobs or gangs, categorized by gender and outfit name. Each outfit is detailed with `outfitData` specifying component items and textures, and `grades` indicating which job ranks have access to it. This allows for granular control over player uniforms. ```lua Config.Outfits = { ["police"] = { ["Male"] = { { name = "Short Sleeve", outfitData = { ["pants"] = { item = 24, texture = 0 }, ["arms"] = { item = 19, texture = 0 }, ["t-shirt"] = { item = 58, texture = 0 }, ["vest"] = { item = 0, texture = 0 }, ["torso2"] = { item = 55, texture = 0 }, ["shoes"] = { item = 51, texture = 0 }, ["accessory"] = { item = 0, texture = 0 }, ["bag"] = { item = 0, texture = 0 }, ["hat"] = { item = -1, texture = -1 }, ["glass"] = { item = 0, texture = 0 }, ["mask"] = { item = 0, texture = 0 } }, grades = { 0, 1, 2, 3, 4 } }, { name = "SWAT", outfitData = { ["pants"] = { item = 130, texture = 1 }, ["arms"] = { item = 172, texture = 0 }, ["torso2"] = { item = 336, texture = 3 }, ["vest"] = { item = 15, texture = 2 }, ["shoes"] = { item = 24, texture = 0 }, ["hat"] = { item = 150, texture = 0 }, ["mask"] = { item = 52, texture = 0 } }, grades = { 3, 4 } -- Only available to higher ranks } }, ["Female"] = { -- Female variants } } } ``` -------------------------------- ### Load Job Outfit (Lua) Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt Applies a job-specific uniform to the player. Requires job name, gender, outfit name, and detailed outfit data for various clothing slots. Grades can also be specified. ```lua -- Load job outfit from config TriggerEvent("illenium-appearance:client:loadJobOutfit", { jobName = "police", gender = "Male", name = "Short Sleeve", outfitData = { ["pants"] = { item = 24, texture = 0 }, ["arms"] = { item = 19, texture = 0 }, ["t-shirt"] = { item = 58, texture = 0 }, ["vest"] = { item = 0, texture = 0 }, ["torso2"] = { item = 55, texture = 0 }, ["shoes"] = { item = 51, texture = 0 }, ["accessory"] = { item = 0, texture = 0 }, ["bag"] = { item = 0, texture = 0 }, ["hat"] = { item = -1, texture = -1 }, ["glass"] = { item = 0, texture = 0 }, ["mask"] = { item = 0, texture = 0 } }, grades = { 0, 1, 2, 3, 4 } }) ``` -------------------------------- ### Open Specialized Shops (Lua) Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt Triggers client-side events to open specific shop interfaces: barber (hair/head overlays), tattoo, or plastic surgeon (face features/head blend). ```lua -- Open barber shop (hair and head overlays) TriggerEvent("illenium-appearance:client:OpenBarberShop") -- Open tattoo shop TriggerEvent("illenium-appearance:client:OpenTattooShop") -- Open plastic surgeon (face features and head blend) TriggerEvent("illenium-appearance:client:OpenSurgeonShop") ``` -------------------------------- ### Configure General Settings for illenium-appearance Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt Defines the core behavior of the resource, including pricing, UI integrations, and feature toggles. Administrators can use this to enable or disable specific clothing components and administrative menus. ```lua Config.Debug = false Config.ClothingCost = 100 Config.BarberCost = 100 Config.TattooCost = 100 Config.SurgeonCost = 100 Config.ChargePerTattoo = true Config.UseTarget = false Config.UseRadialMenu = false Config.UseOxRadial = false Config.EnablePedMenu = true Config.PedMenuGroup = "group.admin" Config.PersistUniforms = false Config.OnDutyOnlyClothingRooms = false Config.BossManagedOutfits = false Config.InvincibleDuringCustomization = true Config.HideRadar = false Config.OutfitCodeLength = 10 Config.ReloadSkinCooldown = 5000 Config.DisableComponents = { Masks = false, UpperBody = false, LowerBody = false, Bags = false, Shoes = false, ScarfAndChains = false, BodyArmor = false, Shirts = false, Decals = false, Jackets = false } Config.DisableProps = { Hats = false, Glasses = false, Ear = false, Watches = false, Bracelets = false } ``` -------------------------------- ### Configure Blacklist for Clothing Items (Lua) Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt This Lua snippet configures a blacklist system to restrict specific clothing items based on job, gang, citizen ID, or ACE permissions. It allows for detailed blacklisting of hair, components (like masks and jackets), and props (like hats and glasses), specifying which attributes (drawables, textures) are affected and which conditions grant an exception. ```lua Config.Blacklist = { male = { hair = { { drawables = { 5, 10, 15 }, -- Blacklisted hair styles jobs = { "police" }, -- Allowed for police gangs = { "vagos" }, -- Allowed for vagos citizenids = { "ABC12345" }, -- Allowed for specific player aces = { "vip.clothing" } -- Allowed with ACE permission } }, components = { masks = { { drawables = { 30, 31, 32 }, textures = { 0, 1, 2 }, -- Specific textures jobs = { "police", "ambulance" } } }, jackets = {}, shirts = {}, shoes = {} }, props = { hats = { { drawables = { 120, 121 }, jobs = { "police" } } }, glasses = {}, watches = {} } }, female = { -- Same structure for female } } ``` -------------------------------- ### Manage Player Outfits Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt Provides functionality to save, delete, and retrieve player outfits. These operations interact with the database to store and manage character clothing sets. ```Lua -- Save outfit local pedModel = exports['illenium-appearance']:getPedModel(PlayerPedId()) local pedComponents = exports['illenium-appearance']:getPedComponents(PlayerPedId()) local pedProps = exports['illenium-appearance']:getPedProps(PlayerPedId()) TriggerServerEvent("illenium-appearance:server:saveOutfit", "My Cool Outfit", pedModel, pedComponents, pedProps) -- Delete outfit TriggerServerEvent("illenium-appearance:server:deleteOutfit", outfitId) ``` -------------------------------- ### Save Player Appearance Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt Handles persistence of character appearance data. It involves capturing the current ped appearance on the client and triggering a server event to save the data to the database. ```Lua -- Server-side: Save appearance RegisterServerEvent("illenium-appearance:server:saveAppearance", function(appearance) local src = source local citizenID = Framework.GetPlayerID(src) if appearance ~= nil then Framework.SaveAppearance(appearance, citizenID) end end) -- Client-side: Trigger save local appearance = exports['illenium-appearance']:getPedAppearance(PlayerPedId()) TriggerServerEvent("illenium-appearance:server:saveAppearance", appearance) ``` -------------------------------- ### Reload Player Skin (Lua) Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt Reloads the player's saved appearance from the database. The boolean argument controls whether a cooldown check is performed. Setting it to true bypasses checks, useful for changing to civilian clothes. ```lua -- Reload skin (with cooldown check) TriggerEvent("illenium-appearance:client:reloadSkin", false) -- Reload skin bypassing checks (use when changing to civilian clothes) TriggerEvent("illenium-appearance:client:reloadSkin", true) ``` -------------------------------- ### Change Player Outfit (Lua) Source: https://context7.com/illeniumstudios/illenium-appearance/llms.txt Applies a saved outfit to the player character. Requires outfit details including name, model, components, and props. The `disableSave` parameter can be set to true for job uniforms. ```lua -- Change to a specific outfit TriggerEvent("illenium-appearance:client:changeOutfit", { name = "Casual Outfit", model = "mp_m_freemode_01", components = { { component_id = 3, drawable = 15, texture = 0 }, -- Arms { component_id = 4, drawable = 21, texture = 0 }, -- Pants { component_id = 6, drawable = 24, texture = 0 }, -- Shoes { component_id = 8, drawable = 15, texture = 0 }, -- Shirt { component_id = 11, drawable = 15, texture = 0 } -- Jacket }, props = { { prop_id = 0, drawable = -1, texture = -1 }, -- Hat { prop_id = 1, drawable = -1, texture = -1 } -- Glasses }, disableSave = false -- Set true for job uniforms }) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.