### Server Configuration Example (cfg) Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/installation/esx This snippet shows the correct order for ensuring ESX, ox_lib, and illenium-appearance in the server.cfg file. Ensure these are added after any existing resource ensures. ```cfg ensure es_extended ensure ox_lib ensure illenium-appearance ``` -------------------------------- ### Install Git on Debian/Ubuntu Source: https://docs-illenium-dev-phem.vercel.app/free-resources/fivem-loki-logging/setup This sequence of commands updates the package list and then installs the Git version control system on Debian-based Linux distributions. The '-y' flag automatically confirms the installation. ```bash apt update apt install git -y ``` -------------------------------- ### Ensure Resources in server.cfg Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/installation/qb-core This snippet shows the correct order to ensure qb-core, ox_lib, and illenium-appearance in your server.cfg file. Ensure these are added after installing the respective resources. ```cfg ensure qb-core ensure ox_lib ensure illenium-appearance ``` -------------------------------- ### Clone Repository and Navigate Source: https://docs-illenium-dev-phem.vercel.app/free-resources/fivem-loki-logging/setup This command clones a Git repository from a specified URL into the current directory and then changes the current directory to the newly cloned repository folder. ```bash git clone https://github.com/iLLeniumStudios/fivem-loki-logging cd fivem-loki-logging ``` -------------------------------- ### Display Configuration File Content Source: https://docs-illenium-dev-phem.vercel.app/free-resources/fivem-loki-logging/setup This command prints the content of the 'config.yaml' file to the terminal, allowing users to verify that their changes have been saved correctly. ```bash cat config.yaml ``` -------------------------------- ### Provide esx_skin and skinchanger (Lua) Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/installation/esx This Lua code snippet demonstrates how to add 'provides' to the fxmanifest.lua file of illenium-appearance. This helps prevent conflicts with older esx_skin and skinchanger resources. ```lua provides { "esx_skin", "skinchanger" } ``` -------------------------------- ### Edit Configuration File with Nano Source: https://docs-illenium-dev-phem.vercel.app/free-resources/fivem-loki-logging/setup This command opens the 'config.yaml' file in the nano text editor, allowing for direct modification of configuration settings within the terminal. ```bash nano config.yaml ``` -------------------------------- ### Connect to VM/VPS via SSH Source: https://docs-illenium-dev-phem.vercel.app/free-resources/fivem-loki-logging/setup This command is used to establish an SSH connection to a remote virtual machine or virtual private server. It requires the username and IP address of the target machine. ```bash ssh @ ``` -------------------------------- ### Send Logs using lib.logger Source: https://docs-illenium-dev-phem.vercel.app/free-resources/fivem-loki-logging/ox_lib Utilize the `lib.logger` function from ox_lib to send log messages to your configured Loki endpoint. The function accepts a source, event, and message, along with optional additional arguments. The example demonstrates logging a vehicle creation event. ```lua lib.logger(source, event, message, ...) -- Example lib.logger(-1, 'CreateVehicle', "A vehicle was created") ``` -------------------------------- ### Disable Props in Lua Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/disabling-components-props This configuration snippet enables disabling accessory props such as Hats, Glasses, Watches, etc., by setting their respective keys to `true` within the `Config.DisableProps` table in `shared/config.lua`. This example shows how to disable Watches. ```lua Config.DisableProps = { Hats = false, Glasses = false, Ear = false, Watches = true, Bracelets = false } ``` -------------------------------- ### Register Server Callback for UpdatePreviewPed - Lua Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/multicharacter/Qbox-project-qb-multicharacter Registers a server-side callback to update the character preview ped. It fetches player skin and data from the database using MySQL.single.await. Dependencies include the MySQL resource and json decoding capabilities. It returns the player's skin, model hash, and gender. ```lua lib.callback.register('qb-multicharacter:callback:UpdatePreviewPed', function(source, CitizenID) local Ped = MySQL.single.await('SELECT * FROM playerskins WHERE citizenid = ?', {CitizenID}) local PlayerData = MySQL.single.await('SELECT * FROM players WHERE citizenid = ?', {CitizenID}) if not Ped or not PlayerData then return end Charinfo = json.decode(PlayerData.charinfo) return Ped.skin, joaat(Ped.model), Charinfo.gender end) ``` -------------------------------- ### Configure ox_lib Logger for Loki Source: https://docs-illenium-dev-phem.vercel.app/free-resources/fivem-loki-logging/ox_lib These configuration variables are essential for ox_lib to connect to and send logs to your Loki instance. Ensure these are added to your server.cfg file. They define the Loki logging backend and connection credentials. ```cfg set ox:logger "loki" set loki:user "admin" set loki:key "supersecurepassword" set loki:protocol "https" set loki:endpoint "loki.fivem-loki-demo.illenium.gg" ``` -------------------------------- ### Client: Modify qb-multicharacter Ped Appearance Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/multicharacter/marcostom32-qb-multicharacter This modification updates the `RegisterNUICallback('cDataPed', ...)` function on the client-side. It handles the creation of a character ped, either by applying a retrieved skin (including model loading, ped creation, and appearance settings) or by creating a ped with a random default model if no skin data is found. It also includes logic for applying ambient animations and freezing ped position. ```lua RegisterNUICallback('cDataPed', function(nData, cb) local cData = nData.cData SetEntityAsMissionEntity(charPed, true, true) DeleteEntity(charPed) if cData ~= nil then QBCore.Functions.TriggerCallback('qb-multicharacter:server:getSkin', function(skinData) if skinData then local model = skinData.model CreateThread(function() RequestModel(GetHashKey(model)) while not HasModelLoaded(GetHashKey(model)) do Wait(10) end charPed = CreatePed(2, model, Config.PedCoords.x, Config.PedCoords.y, Config.PedCoords.z - 0.98, Config.PedCoords.w, false, true) local RandomAnims = { "WORLD_HUMAN_HANG_OUT_STREET", "WORLD HUMAN STAND IMPATIENT", "WORLD_HUMAN_STAND_MOBILE", "WORLD_HUMAN_SMOKING_POT", "WORLD_HUMAN_LEANING", "WORLD_HUMAN_DRUG DEALER_HARD", "WORLD_HUMAN_SUPERHERO", "WORLD_HUMAN_TOURIST_MAP", "WORLD_HUMAN YOGA", "WORLD_HUMAN_BINOCULARS", "WORLD HUMAN BUM WASH", "WORLD_HUMAN_CONST_DRILL", "WORLD_HUMAN_MOBILE_FILM_SHOCKING", "WORLD HUMAN MUSCLE FLEX", "WORLD_HUMAN_MUSICIAN", "WORLD_HUMAN_PAPARAZZI", "WORLD_HUMAN_PARTYING", } local PlayAnim = RandomAnims[math.random(#RandomAnims)] SetPedCanPlayAmbientAnims(charPed, true) TaskStartScenarioInPlace(charPed, PlayAnim, 0, true) SetPedComponentVariation(charPed, 0, 0, 0, 2) FreezeEntityPosition(charPed, false) SetEntityInvincible(charPed, true) PlaceObjectOnGroundProperly(charPed) SetBlockingOfNonTemporaryEvents(charPed, true) exports['illenium-appearance']:setPedAppearance(charPed, skinData) end) else CreateThread(function() local randommodels = { "mp_m_freemode_01", "mp_f_freemode_01", } local model = GetHashKey(randommodels[math.random(1, #randommodels)]) RequestModel(model) while not HasModelLoaded(model) do Wait(0) end charPed = CreatePed(2, model, Config.PedCoords.x, Config.PedCoords.y, Config.PedCoords.z - 0.98, Config.PedCoords.w, false, true) SetPedComponentVariation(charPed, 0, 0, 0, 2) FreezeEntityPosition(charPed, false) SetEntityInvincible(charPed, true) PlaceObjectOnGroundProperly(charPed) SetBlockingOfNonTemporaryEvents(charPed, true) end) end cb("ok") end, cData.citizenid) else CreateThread(function() local randommodels = { "mp_m_freemode_01", "mp_f_freemode_01", } local model = GetHashKey(randommodels[math.random(1, #randommodels)]) RequestModel(model) while not HasModelLoaded(model) do Wait(0) end charPed = CreatePed(2, model, Config.PedCoords.x, Config.PedCoords.y, Config.PedCoords.z - 0.98, Config.PedCoords.w, false, true) SetPedComponentVariation(charPed, 0, 0, 0, 2) FreezeEntityPosition(charPed, false) SetEntityInvincible(charPed, true) PlaceObjectOnGroundProperly(charPed) SetBlockingOfNonTemporaryEvents(charPed, true) end) cb("ok") end end) ``` -------------------------------- ### Add ox_lib to fxmanifest.lua Source: https://docs-illenium-dev-phem.vercel.app/free-resources/fivem-loki-logging/ox_lib Include the ox_lib initialization script in your resource's fxmanifest.lua file. This makes ox_lib's functions, including the logger, available to your server-side scripts. It requires the ox_lib resource to be present and ensured. ```lua shared_script '@ox_lib/init.lua' ``` -------------------------------- ### Enable ACE Permissions in Server Config Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/blacklisting This configuration adds ACE permissions for listing ACEs, allowing them to be used within the server. It is a prerequisite for more advanced ACE permission management. ```lua add_ace resource.illenium-appearance command.list_aces allow ``` -------------------------------- ### Modify qb-multicharacter Client Callback for Ped Appearance Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/multicharacter/OwenT1-qb-multicharacter This snippet modifies the `RegisterNUICallback('cDataPed', ...)` in `qb-multicharacter/client/main.lua`. It handles the creation and display of character peds using retrieved skin data. If skin data exists, it spawns a ped with the specified model, applies random ambient animations, sets the ped's appearance using `illenium-appearance`, and freezes its position. If no skin data is found or `cData` is nil, it spawns a default random model ped. ```lua RegisterNUICallback('cDataPed', function(nData, cb) local cData = nData.cData SetEntityAsMissionEntity(charPed, true, true) DeleteEntity(charPed) if cData ~= nil then QBCore.Functions.TriggerCallback('qb-multicharacter:server:getSkin', function(skinData) if skinData then local model = skinData.model CreateThread(function() RequestModel(GetHashKey(model)) while not HasModelLoaded(GetHashKey(model)) do Wait(10) end charPed = CreatePed(2, model, Config.PedCoords.x, Config.PedCoords.y, Config.PedCoords.z - 0.98, Config.PedCoords.w, false, true) local RandomAnims = { "WORLD_HUMAN_HANG_OUT_STREET", "WORLD HUMAN STAND IMPATIENT", "WORLD_HUMAN_STAND_MOBILE", "WORLD_HUMAN_SMOKING_POT", "WORLD_HUMAN_LEANING", "WORLD_HUMAN_DRUG DEALER_HARD", "WORLD_HUMAN_SUPERHERO", "WORLD_HUMAN_TOURIST_MAP", "WORLD_HUMAN YOGA", "WORLD_HUMAN_BINOCULARS", "WORLD HUMAN BUM WASH", "WORLD_HUMAN_CONST_DRILL", "WORLD_HUMAN_MOBILE_FILM_SHOCKING", "WORLD HUMAN MUSCLE FLEX", "WORLD_HUMAN_MUSICIAN", "WORLD_HUMAN_PAPARAZZI", "WORLD_HUMAN_PARTYING", } local PlayAnim = RandomAnims[math.random(#RandomAnims)] SetPedCanPlayAmbientAnims(charPed, true) TaskStartScenarioInPlace(charPed, PlayAnim, 0, true) SetPedComponentVariation(charPed, 0, 0, 0, 2) FreezeEntityPosition(charPed, false) SetEntityInvincible(charPed, true) PlaceObjectOnGroundProperly(charPed) SetBlockingOfNonTemporaryEvents(charPed, true) exports['illenium-appearance']:setPedAppearance(charPed, skinData) end) else CreateThread(function() local randommodels = { "mp_m_freemode_01", "mp_f_freemode_01", } local model = GetHashKey(randommodels[math.random(1, #randommodels)]) RequestModel(model) while not HasModelLoaded(model) do Wait(0) end charPed = CreatePed(2, model, Config.PedCoords.x, Config.PedCoords.y, Config.PedCoords.z - 0.98, Config.PedCoords.w, false, true) SetPedComponentVariation(charPed, 0, 0, 0, 2) FreezeEntityPosition(charPed, false) SetEntityInvincible(charPed, true) PlaceObjectOnGroundProperly(charPed) SetBlockingOfNonTemporaryEvents(charPed, true) end) end cb("ok") end, cData.citizenid) else CreateThread(function() local randommodels = { "mp_m_freemode_01", "mp_f_freemode_01", } local model = GetHashKey(randommodels[math.random(1, #randommodels)]) RequestModel(model) while not HasModelLoaded(model) do Wait(0) end charPed = CreatePed(2, model, Config.PedCoords.x, Config.PedCoords.y, Config.PedCoords.z - 0.98, Config.PedCoords.w, false, true) SetPedComponentVariation(charPed, 0, 0, 0, 2) FreezeEntityPosition(charPed, false) SetEntityInvincible(charPed, true) PlaceObjectOnGroundProperly(charPed) SetBlockingOfNonTemporaryEvents(charPed, true) end) cb("ok") end end) ``` -------------------------------- ### Modify qb-multicharacter Server Callback for getSkin Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/multicharacter/qb-core-qb-multicharacter This snippet replaces the existing `qb-multicharacter:server:getSkin` callback in `qb-multicharacter/server/main.lua`. It queries the MySQL database for a player's active skin data based on their citizen ID. If found, it returns the decoded JSON skin data; otherwise, it returns nil. This ensures correct skin retrieval for multi-character systems. ```lua QBCore.Functions.CreateCallback("qb-multicharacter:server:getSkin", function(_, cb, cid) local result = MySQL.query.await('SELECT * FROM playerskins WHERE citizenid = ? AND active = ?', {cid, 1}) if result[1] ~= nil then cb(json.decode(result[1].skin)) else cb(nil) end end) ``` -------------------------------- ### Modify qb-multicharacter Client Callback for cDataPed Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/multicharacter/qb-core-qb-multicharacter This snippet replaces the `RegisterNUICallback('cDataPed', ...)` in `qb-multicharacter/client/main.lua`. It handles incoming character data, deletes existing peds, and fetches the player's skin using the `qb-multicharacter:server:getSkin` callback. If skin data exists, it creates a new ped with the specified model and applies the skin using `illenium-appearance`. If no skin data is found, it creates a ped with a random model. This callback is essential for displaying and customizing characters in the multi-character menu. ```lua RegisterNUICallback('cDataPed', function(nData, cb) local cData = nData.cData SetEntityAsMissionEntity(charPed, true, true) DeleteEntity(charPed) if cData ~= nil then QBCore.Functions.TriggerCallback('qb-multicharacter:server:getSkin', function(skinData) if skinData then local model = joaat(skinData.model) CreateThread(function() RequestModel(model) while not HasModelLoaded(model) do Wait(0) end charPed = CreatePed(2, model, Config.PedCoords.x, Config.PedCoords.y, Config.PedCoords.z - 0.98, Config.PedCoords.w, false, true) SetPedComponentVariation(charPed, 0, 0, 0, 2) FreezeEntityPosition(charPed, false) SetEntityInvincible(charPed, true) PlaceObjectOnGroundProperly(charPed) SetBlockingOfNonTemporaryEvents(charPed, true) exports['illenium-appearance']:setPedAppearance(charPed, skinData) end) else CreateThread(function() local randommodels = { "mp_m_freemode_01", "mp_f_freemode_01", } model = joaat(randommodels[math.random(1, #randommodels)]) RequestModel(model) while not HasModelLoaded(model) do Wait(0) end charPed = CreatePed(2, model, Config.PedCoords.x, Config.PedCoords.y, Config.PedCoords.z - 0.98, Config.PedCoords.w, false, true) SetPedComponentVariation(charPed, 0, 0, 0, 2) FreezeEntityPosition(charPed, false) SetEntityInvincible(charPed, true) PlaceObjectOnGroundProperly(charPed) SetBlockingOfNonTemporaryEvents(charPed, true) end) end cb("ok") end, cData.citizenid) else CreateThread(function() local randommodels = { "mp_m_freemode_01", "mp_f_freemode_01", } local model = joaat(randommodels[math.random(1, #randommodels)]) RequestModel(model) while not HasModelLoaded(model) do Wait(0) end charPed = CreatePed(2, model, Config.PedCoords.x, Config.PedCoords.y, Config.PedCoords.z - 0.98, Config.PedCoords.w, false, true) SetPedComponentVariation(charPed, 0, 0, 0, 2) FreezeEntityPosition(charPed, false) SetEntityInvincible(charPed, true) PlaceObjectOnGroundProperly(charPed) SetBlockingOfNonTemporaryEvents(charPed, true) end) cb("ok") end end) ``` -------------------------------- ### Register NUI Callback for Preview Ped - Lua Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/multicharacter/Qbox-project-qb-multicharacter Registers a client-side NUI callback named 'previewPed' to handle the character preview. It retrieves the citizen ID, awaits the server callback 'qb-multicharacter:callback:UpdatePreviewPed' for clothing, model, and gender data. It then updates the player's model and appearance using illenium-appearance exports. Dependencies include lib.callback.await, illenium-appearance, and cache management. ```lua RegisterNUICallback('previewPed', function(Ped, cb) local CID = Ped.Data and Ped.Data.citizenid or nil Clothing, Model, Gender = lib.callback.await('qb-multicharacter:callback:UpdatePreviewPed', false, CID) if Model then local CurrentModel = GetEntityModel(cache.ped) if CurrentModel ~= `mp_m_freemode_01` and Gender == 0 then while not HasModelLoaded(Model) do RequestModel(Model) Wait(0) end SetPlayerModel(cache.playerId, Model) elseif CurrentModel ~= `mp_f_freemode_01` and Gender == 1 then while not HasModelLoaded(Model) do RequestModel(Model) Wait(0) end SetPlayerModel(cache.playerId, Model) end SetModelAsNoLongerNeeded(Model) cache:set('ped', PlayerPedId()) end if Clothing then exports["illenium-appearance"]:setPedAppearance(cache.ped, json.decode(Clothing)) else RandomClothes(cache.ped) end cb('ok') end) ``` -------------------------------- ### Enable ACE Permissions in Shared Config Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/blacklisting This configuration enables the ACE permission system globally within the shared configuration file. It must be set to true to activate ACE-based permission checks. ```lua Config.EnableACEPermissions = true ``` -------------------------------- ### Create and Assign VIP ACE Group Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/blacklisting This snippet demonstrates how to create a new ACE group named 'vip' and assign a player to this group using their license identifier. This is useful for granting specific roles or permissions to players. ```lua add_ace group.vip vip allow add_principal identifier.license:xxxxxxxxxxxxxxxxxx group.vip ``` -------------------------------- ### Server: Modify qb-multicharacter Skin Retrieval Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/multicharacter/marcostom32-qb-multicharacter This modification replaces the existing `qb-multicharacter:server:getSkin` callback. It queries the `playerskins` table in MySQL to retrieve active skin data for a given citizen ID and decodes the JSON skin information. If no active skin is found, it returns nil. ```lua QBCore.Functions.CreateCallback("qb-multicharacter:server:getSkin", function(_, cb, cid) local result = MySQL.query.await('SELECT * FROM playerskins WHERE citizenid = ? AND active = ?', {cid, 1}) if result[1] ~= nil then cb(json.decode(result[1].skin)) else cb(nil) end end) ``` -------------------------------- ### Configure Blacklisted Clothes/Hair Items - Lua Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/blacklisting/clothes This Lua configuration defines items like jackets, masks, hats, and hair that should be blacklisted for specific conditions. It supports blacklisting based on jobs, gangs, ACE permissions, and CitizenIDs, allowing for granular control over item accessibility. ```lua Config.Blacklist = { male = { hair = { { drawables = {15} } }, components = { masks = { { drawables = {10, 11, 12, 13} }, { drawables = {14}, textures = {5, 7, 10, 11, 12, 13} } }, upperBody = {}, lowerBody = {}, bags = {}, shoes = {}, scarfAndChains = { { drawables = {5, 6, 7}, aces = {"vip"} } }, shirts = { { drawables = {16}, citizenids = {"ZUM10723"} } }, bodyArmor = {}, decals = {}, jackets = { { drawables = {11}, textures = {1, 2, 3} }, { drawables = {10, 12, 13, 18} }, { drawables = {25, 30, 35}, jobs = {"police"} } } }, props = { hats = { { drawables = {41, 42, 45}, gangs = {"ballas"} } }, glasses = {}, ear = {}, watches = {}, bracelets = {} } }, female = { components = { masks = {}, upperBody = {}, lowerBody = {}, bags = {}, shoes = {}, scarfAndChains = {}, shirts = {}, bodyArmor = {}, decals = {}, jackets = {} }, props = { hats = {}, glasses = {}, ear = {}, watches = {}, bracelets = {} } } } ``` -------------------------------- ### Disable Components in Lua Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/disabling-components-props This configuration snippet allows disabling various clothing components by setting their corresponding keys to `true` in the `Config.DisableComponents` table within `shared/config.lua`. This affects items like Masks, UpperBody, etc. ```lua Config.DisableComponents = { Masks = true, UpperBody = false, LowerBody = false, Bags = false, Shoes = false, ScarfAndChains = false, BodyArmor = false, Shirts = false, Decals = false, Jackets = false } ``` -------------------------------- ### Configure Ped Blacklisting in Lua Source: https://docs-illenium-dev-phem.vercel.app/free-resources/illenium-appearance/blacklisting/peds This Lua configuration snippet demonstrates how to define blacklisted peds in `shared/peds.lua`. It shows how to associate specific peds with job, gang, or ACE restrictions. The format allows for multiple criteria to be applied to a single ped or group of peds. ```lua Config.Peds = { pedConfig = { { peds = {...} }, { peds = {"a_f_m_beach_01", "a_f_m_bevhills_01", "a_f_m_bevhills_02"}, jobs = {"police"} }, { peds = {"a_f_m_bodybuild_01"}, gangs = {"vagos"} }, { peds = {"a_f_m_downtown_01"}, aces = {"admin"} }, { peds = {"a_f_m_skidrow_01"}, jobs = {"police"}, gangs = {"ballas"} } } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.