diff --git a/[esx_addons]/esx_lscustom/client/main.lua b/[esx_addons]/esx_lscustom/client/main.lua index c5c79fd6..7b684ed4 100644 --- a/[esx_addons]/esx_lscustom/client/main.lua +++ b/[esx_addons]/esx_lscustom/client/main.lua @@ -163,6 +163,14 @@ function UpdateMods(data) props['modSmokeEnabled'] = true ESX.Game.SetVehicleProperties(vehicle, props) props = {} + elseif data.modType == 'xenonColor' then + if data.modNum then + props['modXenon'] = true + else + props['modXenon'] = false + end + ESX.Game.SetVehicleProperties(vehicle, props) + props = {} end props[data.modType] = data.modNum @@ -211,7 +219,7 @@ function GetAction(data) if v.modType then - if v.modType == 22 then + if v.modType == 22 or v.modType == 'xenonColor' then table.insert(elements, { label = " " .. TranslateCap('by_default'), modType = k, @@ -290,6 +298,17 @@ function GetAction(data) modType = k, modNum = true }) + elseif v.modType == 'xenonColor' then -- XENON COLOR + local xenonColors = GetXenonColors() + price = math.floor(vehiclePrice * v.price / 100) + for i = 1, #xenonColors, 1 do + print(xenonColors[i].label, xenonColors[i].index) + table.insert(elements, { + label = xenonColors[i].label .. ' - $' .. price .. '', + modType = k, + modNum = xenonColors[i].index + }) + end elseif v.modType == 'neonColor' or v.modType == 'tyreSmokeColor' then -- NEON & SMOKE COLOR local neons = GetNeons() price = math.floor(vehiclePrice * v.price / 100) diff --git a/[esx_addons]/esx_lscustom/config.lua b/[esx_addons]/esx_lscustom/config.lua index 3ed2514d..7d3c951d 100644 --- a/[esx_addons]/esx_lscustom/config.lua +++ b/[esx_addons]/esx_lscustom/config.lua @@ -425,6 +425,27 @@ function GetNeons() return neons end +function GetXenonColors() + local xenonColors = { + {label = TranslateCap('neon'), index = -1}, + {label = TranslateCap('white'), index = 0}, + {label = TranslateCap('blue'), index = 1}, + {label = "Electric Blue", index = 2}, + {label = "Mint Green", index = 3}, + {label = "Lime Green", index = 4}, + {label = TranslateCap('yellow'), index = 5}, + {label = "Golden Shower", index = 6}, + {label = TranslateCap('orange'), index = 7}, + {label = TranslateCap('red'), index = 8}, + {label = "Pony Pink", index = 9}, + {label = "Hot Pink", index = 10}, + {label = TranslateCap('purple'), index = 11}, + {label = "Blacklight", index = 11}, + } + + return xenonColors +end + function GetPlatesName(index) if (index == 0) then return TranslateCap('blue_on_white_1') @@ -500,7 +521,8 @@ Config.Menus = { modHorns = TranslateCap('horns'), neonColor = TranslateCap('neons'), resprays = TranslateCap('respray'), - modXenon = TranslateCap('headlights'), + -- modXenon = TranslateCap('headlights'), + xenonColor = TranslateCap('headlights'), plateIndex = TranslateCap('licenseplates'), wheels = TranslateCap('wheels'), modPlateHolder = TranslateCap('modplateholder'), @@ -801,6 +823,12 @@ Config.Menus = { modType = 22, price = 3.72 }, + xenonColor = { + label = TranslateCap('headlights'), + parent = 'cosmetics', + modType = 'xenonColor', + price = 3.72 + }, bodyparts = { label = TranslateCap('bodyparts'), parent = 'cosmetics',