From 301b0693120226c9646c76995c25d3af4200de32 Mon Sep 17 00:00:00 2001 From: Jim Shield Date: Tue, 9 Sep 2025 18:49:26 +0100 Subject: [PATCH] add openClothin() function Attempts to open clothing scripts menus Still testing this one --- shared/playerfunctions.lua | 47 ++++++++++++++++++++++++++++++++++++++ shared/targets.lua | 4 ---- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/shared/playerfunctions.lua b/shared/playerfunctions.lua index 268ea5b..8104bb5 100644 --- a/shared/playerfunctions.lua +++ b/shared/playerfunctions.lua @@ -897,4 +897,51 @@ function GetPlayersFromCoords(coords, radius) end end return players +end + +------------------------------------------------------------- +-- Clothing Script Selection +------------------------------------------------------------- + +local wardrobeFunc = { + { name = "qb-clothing", + openWardrobe = function() + TriggerEvent("qb-clothing:client:OpenMenu") + end, + }, + { name = "esx_skin", + openWardrobe = function() + TriggerEvent("esx_skin:openSaveableMenu", + function() + finished = true + end, function() + finished = true + end) + end, + }, + { name = "illenium-appearance", + openWardrobe = function() + exports['illenium-appearance']:startPlayerCustomization(function(appearance) + if appearance then + TriggerServerEvent("illenium-appearance:server:saveAppearance", appearance) + end + end, { + components = true, componentConfig = { masks = true, upperBody = true, lowerBody = true, bags = true, shoes = true, scarfAndChains = true, bodyArmor = true, shirts = true, decals = true, jackets = true }, + props = true, propConfig = { hats = true, glasses = true, ear = true, watches = true, bracelets = true }, + enableExit = true, + }) + end, + }, +} + +--- Opens the clothing customization menu + +function openClothing() + for i = 1, #wardrobeFunc do + local script = wardrobeFunc[i] + if isStarted(script.name) then + script.openWardrobe() + break + end + end end \ No newline at end of file diff --git a/shared/targets.lua b/shared/targets.lua index fdf993c..de1efca 100644 --- a/shared/targets.lua +++ b/shared/targets.lua @@ -535,10 +535,6 @@ function ShowFloatingHelpNotification(coord, text, highlight) EndTextCommandDisplayHelp(2, false, false, -1) end -function updateCachedText(target) - target.text = table.concat(target.buttontext, "\n") -end - ------------------------------------------------------------- -- Cleanup on Resource Stop -------------------------------------------------------------