From b563cedc66e68284fa2dd54314baf734e5386e71 Mon Sep 17 00:00:00 2001 From: Lollypop Date: Tue, 30 Jan 2018 00:38:15 +0100 Subject: [PATCH 1/2] Fix turbo Adds exceptions for buying turbo because turbos "modNum" is currently a boolean but it is used as an index for an array which gives off a lua error and makes it impossible to purchase it --- client/main.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/client/main.lua b/client/main.lua index 731029f5..71bb82a1 100644 --- a/client/main.lua +++ b/client/main.lua @@ -78,9 +78,12 @@ function OpenLSMenu(elems, menuname, menutitle, parent) if isRimMod then price = math.floor(vehiclePrice * data.current.price / 100) TriggerServerEvent("esx_lscustom:buyMod", price) - elseif v.modType == 11 or v.modType == 12 or v.modType == 13 or v.modType == 15 or v.modType == 16 or v.modType == 17 then + elseif v.modType == 11 or v.modType == 12 or v.modType == 13 or v.modType == 15 or v.modType == 16 then price = math.floor(vehiclePrice * v.price[data.current.modNum + 1] / 100) TriggerServerEvent("esx_lscustom:buyMod", price) + elseif v.modType == 17 then + price = math.floor(vehiclePrice * v.price[1] / 100) + TriggerServerEvent("esx_lscustom:buyMod", price) else price = math.floor(vehiclePrice * v.price / 100) TriggerServerEvent("esx_lscustom:buyMod", price) @@ -303,10 +306,10 @@ function GetAction(data) end elseif v.modType == 17 then -- TURBO local _label = '' - if currentMods.modTurbo then + if currentMods[k] then _label = 'Turbo - '.. _U('installed') ..'' else - _label = 'Turbo - $' .. v.price .. ' ' + _label = 'Turbo - $' .. v.price[1] .. ' ' end table.insert(elements, {label = _label, modType = k, modNum = true}) else @@ -419,4 +422,4 @@ Citizen.CreateThread(function() end end -end) \ No newline at end of file +end) From d2f420ec5c7febb2c3e7f5d3f7f4b1cde8b4e912 Mon Sep 17 00:00:00 2001 From: Lollypop Date: Thu, 8 Feb 2018 03:52:48 +0100 Subject: [PATCH 2/2] Fix the price aswell --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 71bb82a1..59d2ed35 100644 --- a/client/main.lua +++ b/client/main.lua @@ -309,7 +309,7 @@ function GetAction(data) if currentMods[k] then _label = 'Turbo - '.. _U('installed') ..'' else - _label = 'Turbo - $' .. v.price[1] .. ' ' + _label = 'Turbo - $' .. math.floor(vehiclePrice * v.price[1] / 100) .. ' ' end table.insert(elements, {label = _label, modType = k, modNum = true}) else