From b5b7a97275d15655161d4fea50778711d7167809 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Sat, 16 Nov 2024 00:47:06 +0530 Subject: [PATCH 01/15] Update pt.lua to fix typo --- locales/pt.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/pt.lua b/locales/pt.lua index 26c2e3b..f5dc884 100644 --- a/locales/pt.lua +++ b/locales/pt.lua @@ -59,7 +59,7 @@ local Translations = { kicked_server = 'Foste expulso do servidor', check_discord = '🔸 Aparece no nosso Discord para mais informações: ', banned = 'Foste banido:', - ban_perm = '\n\O teu ban é permanente.\n🔸 Entra no nosso Discord para mais informações: ', + ban_perm = '\n\nO teu ban é permanente.\n🔸 Entra no nosso Discord para mais informações: ', ban_expires = '\n\nO ban expira em: ', rank_level = 'Seu nível de permissão é agora ', admin_report = 'Relatório de administração - ', From 15b642272bc2e18b972208e2482f0192c4cea709 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Sat, 16 Nov 2024 11:15:43 +0530 Subject: [PATCH 02/15] Removed unused variable --- server/server.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/server/server.lua b/server/server.lua index c9ac5cf..3c1d8b5 100644 --- a/server/server.lua +++ b/server/server.lua @@ -271,7 +271,6 @@ end) RegisterServerEvent('qb-admin:giveWeapon', function(weapon) local src = source if QBCore.Functions.HasPermission(src, 'admin') or IsPlayerAceAllowed(src, 'command') then - local Player = QBCore.Functions.GetPlayer(src) exports['qb-inventory']:AddItem(src, weapon, 1, false, false, 'qb-admin:giveWeapon') else BanPlayer(src) From f745ec35a60a6715c49a44e56fa9f603db319121 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Sun, 17 Nov 2024 15:39:15 +0530 Subject: [PATCH 03/15] Added Vechicle modification configurations. --- shared/vehicles.lua | 1055 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1055 insertions(+) create mode 100644 shared/vehicles.lua diff --git a/shared/vehicles.lua b/shared/vehicles.lua new file mode 100644 index 0000000..5b73083 --- /dev/null +++ b/shared/vehicles.lua @@ -0,0 +1,1055 @@ +VehicleMods = {}; +VehicleMods.enabled = true; +VehicleMods.FuelResource = "LegacyFuel"; +VehicleMods.colors = { + { + name = "Black", + colorindex = 0 + }, + { + name = "Carbon Black", + colorindex = 147 + }, + { + name = "Graphite", + colorindex = 1 + }, + { + name = "Anthracite Black", + colorindex = 11 + }, + { + name = "Black Steel", + colorindex = 2 + }, + { + name = "Dark Steel", + colorindex = 3 + }, + { + name = "Silver", + colorindex = 4 + }, + { + name = "Bluish Silver", + colorindex = 5 + }, + { + name = "Rolled Steel", + colorindex = 6 + }, + { + name = "Shadow Silver", + colorindex = 7 + }, + { + name = "Stone Silver", + colorindex = 8 + }, + { + name = "Midnight Silver", + colorindex = 9 + }, + { + name = "Cast Iron Silver", + colorindex = 10 + }, + { + name = "Red", + colorindex = 27 + }, + { + name = "Torino Red", + colorindex = 28 + }, + { + name = "Formula Red", + colorindex = 29 + }, + { + name = "Lava Red", + colorindex = 150 + }, + { + name = "Blaze Red", + colorindex = 30 + }, + { + name = "Grace Red", + colorindex = 31 + }, + { + name = "Garnet Red", + colorindex = 32 + }, + { + name = "Sunset Red", + colorindex = 33 + }, + { + name = "Cabernet Red", + colorindex = 34 + }, + { + name = "Wine Red", + colorindex = 143 + }, + { + name = "Candy Red", + colorindex = 35 + }, + { + name = "Hot Pink", + colorindex = 135 + }, + { + name = "Pfsiter Pink", + colorindex = 137 + }, + { + name = "Salmon Pink", + colorindex = 136 + }, + { + name = "Sunrise Orange", + colorindex = 36 + }, + { + name = "Orange", + colorindex = 38 + }, + { + name = "Bright Orange", + colorindex = 138 + }, + { + name = "Gold", + colorindex = 99 + }, + { + name = "Bronze", + colorindex = 90 + }, + { + name = "Yellow", + colorindex = 88 + }, + { + name = "Race Yellow", + colorindex = 89 + }, + { + name = "Dew Yellow", + colorindex = 91 + }, + { + name = "Dark Green", + colorindex = 49 + }, + { + name = "Racing Green", + colorindex = 50 + }, + { + name = "Sea Green", + colorindex = 51 + }, + { + name = "Olive Green", + colorindex = 52 + }, + { + name = "Bright Green", + colorindex = 53 + }, + { + name = "Gasoline Green", + colorindex = 54 + }, + { + name = "Lime Green", + colorindex = 92 + }, + { + name = "Midnight Blue", + colorindex = 141 + }, + { + name = "Galaxy Blue", + colorindex = 61 + }, + { + name = "Dark Blue", + colorindex = 62 + }, + { + name = "Saxon Blue", + colorindex = 63 + }, + { + name = "Blue", + colorindex = 64 + }, + { + name = "Mariner Blue", + colorindex = 65 + }, + { + name = "Harbor Blue", + colorindex = 66 + }, + { + name = "Diamond Blue", + colorindex = 67 + }, + { + name = "Surf Blue", + colorindex = 68 + }, + { + name = "Nautical Blue", + colorindex = 69 + }, + { + name = "Racing Blue", + colorindex = 73 + }, + { + name = "Ultra Blue", + colorindex = 70 + }, + { + name = "Light Blue", + colorindex = 74 + }, + { + name = "Chocolate Brown", + colorindex = 96 + }, + { + name = "Bison Brown", + colorindex = 101 + }, + { + name = "Creeen Brown", + colorindex = 95 + }, + { + name = "Feltzer Brown", + colorindex = 94 + }, + { + name = "Maple Brown", + colorindex = 97 + }, + { + name = "Beechwood Brown", + colorindex = 103 + }, + { + name = "Sienna Brown", + colorindex = 104 + }, + { + name = "Saddle Brown", + colorindex = 98 + }, + { + name = "Moss Brown", + colorindex = 100 + }, + { + name = "Woodbeech Brown", + colorindex = 102 + }, + { + name = "Straw Brown", + colorindex = 99 + }, + { + name = "Sandy Brown", + colorindex = 105 + }, + { + name = "Bleached Brown", + colorindex = 106 + }, + { + name = "Schafter Purple", + colorindex = 71 + }, + { + name = "Spinnaker Purple", + colorindex = 72 + }, + { + name = "Midnight Purple", + colorindex = 142 + }, + { + name = "Bright Purple", + colorindex = 145 + }, + { + name = "Cream", + colorindex = 107 + }, + { + name = "Ice White", + colorindex = 111 + }, + { + name = "Frost White", + colorindex = 112 + } +}; +VehicleMods.metalcolors = { + { + name = "Brushed Steel", + colorindex = 117 + }, + { + name = "Brushed Black Steel", + colorindex = 118 + }, + { + name = "Brushed Aluminum", + colorindex = 119 + }, + { + name = "Pure Gold", + colorindex = 158 + }, + { + name = "Brushed Gold", + colorindex = 159 + }, + { + name = "Chrome", + colorindex = 120 + } +}; +VehicleMods.mattecolors = { + { + name = "Black", + colorindex = 12 + }, + { + name = "Gray", + colorindex = 13 + }, + { + name = "Light Gray", + colorindex = 14 + }, + { + name = "Ice White", + colorindex = 131 + }, + { + name = "Blue", + colorindex = 83 + }, + { + name = "Dark Blue", + colorindex = 82 + }, + { + name = "Midnight Blue", + colorindex = 84 + }, + { + name = "Midnight Purple", + colorindex = 149 + }, + { + name = "Schafter Purple", + colorindex = 148 + }, + { + name = "Red", + colorindex = 39 + }, + { + name = "Dark Red", + colorindex = 40 + }, + { + name = "Orange", + colorindex = 41 + }, + { + name = "Yellow", + colorindex = 42 + }, + { + name = "Lime Green", + colorindex = 55 + }, + { + name = "Green", + colorindex = 128 + }, + { + name = "Frost Green", + colorindex = 151 + }, + { + name = "Foliage Green", + colorindex = 155 + }, + { + name = "Olive Darb", + colorindex = 152 + }, + { + name = "Dark Earth", + colorindex = 153 + }, + { + name = "Desert Tan", + colorindex = 154 + } +}; +VehicleMods.tyrecolors = { + { + name = "Black", + r = 0, + g = 0, + b = 0 + }, + { + name = "White\t", + r = 255, + g = 255, + b = 255 + }, + { + name = "Red", + r = 255, + g = 0, + b = 0 + }, + { + name = "Lime", + r = 0, + g = 255, + b = 0 + }, + { + name = "Blue", + r = 0, + g = 0, + b = 255 + }, + { + name = "Yellow", + r = 255, + g = 255, + b = 0 + }, + { + name = "Cyan", + r = 0, + g = 255, + b = 255 + }, + { + name = "Magenta", + r = 255, + g = 0, + b = 255 + }, + { + name = "Silver", + r = 192, + g = 192, + b = 192 + }, + { + name = "Gray", + r = 128, + g = 128, + b = 128 + }, + { + name = "Maroon", + r = 128, + g = 0, + b = 0 + }, + { + name = "Olive", + r = 128, + g = 128, + b = 0 + }, + { + name = "Green", + r = 0, + g = 128, + b = 0 + }, + { + name = "Purple", + r = 128, + g = 0, + b = 128 + }, + { + name = "Green", + r = 0, + g = 128, + b = 0 + }, + { + name = "Teal", + r = 0, + g = 128, + b = 128 + }, + { + name = "Navy Blue", + r = 0, + g = 0, + b = 128 + } +}; +VehicleMods.neoncolors = { + { + label = "White", + value = { + 222, + 222, + 255 + }, + description = "Demo Item 1" + }, + { + label = "Blue", + value = { + 2, + 21, + 255 + }, + description = "Demo Item 2" + }, + { + label = "Electric Blue", + value = { + 3, + 83, + 255 + }, + description = "Demo Item 3" + }, + { + label = "Mint Green", + value = { + 0, + 222, + 140 + }, + description = "Demo Item 4" + }, + { + label = "Lime Green", + value = { + 94, + 222, + 1 + }, + description = "Demo Item 4" + }, + { + label = "Yellow", + value = { + 255, + 255, + 0 + }, + description = "Demo Item 4" + }, + { + label = "Golden Shower", + value = { + 255, + 150, + 0 + }, + description = "Demo Item 4" + }, + { + label = "Orange", + value = { + 255, + 62, + 0 + }, + description = "Demo Item 4" + }, + { + label = "Red", + value = { + 255, + 1, + 1 + }, + description = "Demo Item 4" + }, + { + label = "Pony Pink", + value = { + 255, + 50, + 100 + }, + description = "Demo Item 4" + }, + { + label = "Hot Pink", + value = { + 255, + 5, + 190 + }, + description = "Demo Item 4" + }, + { + label = "Purple", + value = { + 35, + 1, + 255 + }, + description = "Demo Item 4" + }, + { + label = "Blacklight", + value = { + 15, + 3, + 255 + }, + description = "Demo Item 4" + } +}; +VehicleMods.vehmods = { + modTurbo = { + label = "Turbo", + parent = "upgrades", + modType = 17, + price = { + 55.81 + } + }, + modEngine = { + label = "Engine", + parent = "upgrades", + modType = 11, + price = { + 13.95, + 32.56, + 65.12, + 139.53 + } + }, + modBrakes = { + label = "Brakes", + parent = "upgrades", + modType = 12, + price = { + 4.65, + 9.3, + 18.6, + 13.95 + } + }, + modTransmission = { + label = "Transmission", + parent = "upgrades", + modType = 13, + price = { + 13.95, + 20.93, + 46.51 + } + }, + modSuspension = { + label = "Suspension", + parent = "upgrades", + modType = 15, + price = { + 3.72, + 7.44, + 14.88, + 29.77, + 40.2 + } + }, + modArmor = { + label = "Armor", + parent = "upgrades", + modType = 16, + price = { + 69.77, + 116.28, + 130, + 150, + 180, + 190 + } + }, + modPlateHolder = { + label = "Plate - Back", + parent = "cosmetics", + modType = 25, + price = 3.49 + }, + modVanityPlate = { + label = "Plate - Front", + parent = "cosmetics", + modType = 26, + price = 1.1 + }, + modTrimA = { + label = "Interior", + parent = "cosmetics", + modType = 27, + price = 6.98 + }, + modOrnaments = { + label = "Trim", + parent = "cosmetics", + modType = 28, + price = 0.9 + }, + modDashboard = { + label = "Dashboard", + parent = "cosmetics", + modType = 29, + price = 4.65 + }, + modDial = { + label = "Speedometer", + parent = "cosmetics", + modType = 30, + price = 4.19 + }, + modDoorSpeaker = { + label = "Door Speakers", + parent = "cosmetics", + modType = 31, + price = 5.58 + }, + modSeats = { + label = "Seats", + parent = "cosmetics", + modType = 32, + price = 4.65 + }, + modSteeringWheel = { + label = "Steering Wheel", + parent = "cosmetics", + modType = 33, + price = 4.19 + }, + modShifterLeavers = { + label = "Gear Lever", + parent = "cosmetics", + modType = 34, + price = 3.26 + }, + modAPlate = { + label = "Quarter-Deck", + parent = "cosmetics", + modType = 35, + price = 4.19 + }, + modSpeakers = { + label = "Speakers", + parent = "cosmetics", + modType = 36, + price = 6.98 + }, + modTrunk = { + label = "Trunk", + parent = "cosmetics", + modType = 37, + price = 5.58 + }, + modHydrolic = { + label = "Hydraulic", + parent = "cosmetics", + modType = 38, + price = 5.12 + }, + modEngineBlock = { + label = "Engine Block", + parent = "cosmetics", + modType = 39, + price = 5.12 + }, + modAirFilter = { + label = "Air Filter", + parent = "cosmetics", + modType = 40, + price = 3.72 + }, + modStruts = { + label = "Struts", + parent = "cosmetics", + modType = 41, + price = 6.51 + }, + modArchCover = { + label = "Arch Cover", + parent = "cosmetics", + modType = 42, + price = 4.19 + }, + modAerials = { + label = "Aerials", + parent = "cosmetics", + modType = 43, + price = 1.12 + }, + modTrimB = { + label = "Wings", + parent = "cosmetics", + modType = 44, + price = 6.05 + }, + modTank = { + label = "Fuel Tank", + parent = "cosmetics", + modType = 45, + price = 4.19 + }, + modWindows = { + label = "Windows", + parent = "cosmetics", + modType = 46, + price = 4.19 + }, + modLivery = { + label = "Stickers", + parent = "cosmetics", + modType = 48, + price = 9.3 + }, + modFrontWheelsType0 = { + label = "Sport", + parent = "modFrontWheelsTypes", + modType = 23, + wheelType = 0, + price = 4.65 + }, + modFrontWheelsType1 = { + label = "Muscle", + parent = "modFrontWheelsTypes", + modType = 23, + wheelType = 1, + price = 4.19 + }, + modFrontWheelsType2 = { + label = "Low Rider", + parent = "modFrontWheelsTypes", + modType = 23, + wheelType = 2, + price = 4.65 + }, + modFrontWheelsType3 = { + label = "SUV", + parent = "modFrontWheelsTypes", + modType = 23, + wheelType = 3, + price = 4.19 + }, + modFrontWheelsType4 = { + label = "All Terrain", + parent = "modFrontWheelsTypes", + modType = 23, + wheelType = 4, + price = 4.19 + }, + modFrontWheelsType5 = { + label = "Tuning", + parent = "modFrontWheelsTypes", + modType = 23, + wheelType = 5, + price = 5.12 + }, + modFrontWheelsType6 = { + label = "Motorcycle", + parent = "modFrontWheelsTypes", + modType = 23, + wheelType = 6, + price = 3.26 + }, + modFrontWheelsType7 = { + label = "Highend", + parent = "modFrontWheelsTypes", + modType = 23, + wheelType = 7, + price = 5.12 + }, + wheelColor = { + label = "Wheel Color", + parent = "modFrontWheelsColor", + modType = "wheelColor", + price = 0.66 + }, + plateIndex = { + label = "License Plates", + parent = "cosmetics", + modType = "plateIndex", + price = 1.1 + }, + color1 = { + label = "Primary Color", + parent = "primaryRespray", + modType = "color1", + price = 1.12 + }, + color2 = { + label = "Secondary Color", + parent = "secondaryRespray", + modType = "color2", + price = 0.66 + }, + pearlescentColor = { + label = "Pearlescent Color", + parent = "pearlescentRespray", + modType = "pearlescentColor", + price = 0.88 + }, + modXenon = { + label = "Headlight", + parent = "cosmetics", + modType = 22, + price = 3.72 + }, + modSpoilers = { + label = "Spoilers", + parent = "bodyparts", + modType = 0, + price = 4.65 + }, + modFrontBumper = { + label = "Front Bumper", + parent = "bodyparts", + modType = 1, + price = 5.12 + }, + modRearBumper = { + label = "Rear Bumper", + parent = "bodyparts", + modType = 2, + price = 5.12 + }, + modSideSkirt = { + label = "Sideskirt", + parent = "bodyparts", + modType = 3, + price = 4.65 + }, + modExhaust = { + label = "Exhaust", + parent = "bodyparts", + modType = 4, + price = 5.12 + }, + modFrame = { + label = "Cage", + parent = "bodyparts", + modType = 5, + price = 5.12 + }, + modGrille = { + label = "Grille", + parent = "bodyparts", + modType = 6, + price = 3.72 + }, + modHood = { + label = "Hood", + parent = "bodyparts", + modType = 7, + price = 4.88 + }, + modFender = { + label = "Left Fender", + parent = "bodyparts", + modType = 8, + price = 5.12 + }, + modRightFender = { + label = "Right Fender", + parent = "bodyparts", + modType = 9, + price = 5.12 + }, + modRoof = { + label = "Roof", + parent = "bodyparts", + modType = 10, + price = 5.58 + }, + modHorns = { + label = "Horns", + parent = "cosmetics", + modType = 14, + price = 1.12 + }, + neonColor = { + label = "Neon", + parent = "cosmetics", + modType = "neonColor", + price = 1.12 + }, + tyreSmokeColor = { + label = "Tiresmoke", + parent = "wheels", + modType = "tyreSmokeColor", + price = 1.12 + }, + modSticker = { + label = "Livery 2", + parent = "cosmetics", + modType = "livery2", + price = 9.3 + } +}; +VehicleMods.vehicledoors = { + { + label = "LFront Door", + value = 0, + description = "Left Front Door" + }, + { + label = "RFront Door", + value = 1, + description = "Right Front Door" + }, + { + label = "LRear Door", + value = 2, + description = "Left Rear Door" + }, + { + label = "RRear Door", + value = 3, + description = "Right Rear Door" + }, + { + label = "Hood", + value = 4, + description = "Hood" + }, + { + label = "Trunk", + value = 5, + description = "Trunk" + } +}; From 60b36ebfca7f00e3ae7ddeb58e88bdba2b4af467 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Sun, 17 Nov 2024 15:39:49 +0530 Subject: [PATCH 04/15] Added english language for vehicle modificaitons. --- locales/en.lua | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/locales/en.lua b/locales/en.lua index 1ca41e8..a186a95 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -15,6 +15,7 @@ local Translations = { failed_set_speed = 'You did not set a speed.. (`fast` for super-run, `normal` for normal)', failed_set_model = 'You did not set a model..', failed_entity_copy = 'No freeaim entity info to copy to clipboard!', + no_plate_text = 'No plate text entered', }, success = { blips_activated = 'Blips activated', @@ -29,6 +30,7 @@ local Translations = { spawn_weapon = 'You have spawned a Weapon ', noclip_enabled = 'No-clip enabled', noclip_disabled = 'No-clip disabled', + plate_changed_to = 'Plate changed to %{plate}' }, info = { ped_coords = 'Ped Coordinates:', @@ -157,6 +159,40 @@ local Translations = { entity_view_freeaim_copy = 'Copy Freeaim Entity Info', spawn_weapons = 'Spawn Weapons', max_mods = 'Max car mods', + change = 'Change', + vehicle_moddings = 'Vehicle Moddings', + vehicle = { + vehicle_options = 'Vehicle Options', + vehicle_color = 'Vehicle Color', + headlights_color = 'Headlights Color', + modifications = 'Modifications', + color_menu = 'Color Menu', + classic_colors = 'Classic Colors', + tyre_smoke_colors = 'Tyre Smoke Colors', + metal_colors = 'Metal Colors', + matte_colors = 'Matte Colors', + neon_options = 'Neon Options', + neon_color = 'Neon Color', + primary_color = 'Primary Color', + secondary_color = 'Secondary Color', + pearlescent_color = 'Pearlescent Color', + wheel_color = 'Wheel Color', + dashboard_color = 'Dashboard Color', + interior_color = 'Interior Color', + enable_front_neon = 'Enable Front Neon', + enable_back_neon = 'Enable Back Neon', + enable_left_neon = 'Enable Left Neon', + enable_right_neon = 'Enable Right Neon', + window_tint = 'Window Tint', + toggle_engine = 'Toggle Engine', + change_numberplate = 'Change Numberplate', + enter_new_plate = 'Enter New Plate', + toggle_doors = 'Toggle Doors', + flip_vehicle = 'Flip Vehicle', + delete_vehicle = 'Delete Vehicle', + repair_vehicle = 'Repair Vehicle', + wash_vehicle = 'Wash Vehicle', + } }, desc = { admin_options_desc = 'Misc. Admin Options', @@ -200,6 +236,37 @@ local Translations = { entity_view_freeaim_copy_desc = 'Copies the Free Aim entity info to clipboard', spawn_weapons_desc = 'Spawn Any Weapon.', max_mod_desc = 'Max mod your current vehicle', + vehicle_moddings_desc = 'Vehicle Modding Options', + vehicle = { + modifications = 'Vehicle Modifications Menu', + vehicle_color = 'Vehicle Color Menu', + tyre_smoke_colors = 'Tyre Smoke Color Menu', + headlights_color = 'Headlights Color Menu', + neon_options = 'Neon Options', + classic_colors = 'Classic Color', + matte_colors = 'Matte Color', + metal_colors = 'Metal Color', + neon_color = 'Neon Color', + primary_color = 'Primary Color', + secondary_color = 'Secondary Color', + pearlescent_color = 'Pearlescent Color', + wheel_color = 'Wheel Color', + dashboard_color = 'Dashboard Color', + interior_color = 'Interior Color', + enable_front_neon = 'Enable Front Neon', + enable_back_neon = 'Enable Back Neon', + enable_left_neon = 'Enable Left Neon', + enable_right_neon = 'Enable Right Neon', + window_tint = 'Window Tint Menu', + change_numberplate = 'Change Numberplate Text', + toggle_doors = 'Toggle Doors Menu', + flip_vehicle = 'Flip Vehicle', + toggle_engine = 'Toggle Engine you are in', + delete_vehicle = 'Delete vehicle you are in', + repair_vehicle = 'Repair vehicle you are in', + wash_vehicle = 'Wash vehicle you are in', + extras = 'Extras', + } }, time = { ban_length = 'Ban Length', From 774827fa050e3480e808e3ab5cd5974167202ae1 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Sun, 17 Nov 2024 15:40:32 +0530 Subject: [PATCH 05/15] Added Vehicle modifications menu. --- client/client.lua | 702 +++++++++++++++++++++++++++++++++++++++++++++- fxmanifest.lua | 3 +- 2 files changed, 690 insertions(+), 15 deletions(-) diff --git a/client/client.lua b/client/client.lua index 7fe3e96..de55ce6 100644 --- a/client/client.lua +++ b/client/client.lua @@ -7,23 +7,56 @@ local kickreason = 'Unknown' local menuLocation = 'topright' -- e.g. topright (default), topleft, bottomright, bottomleft -- Main Menus -local menu1 = MenuV:CreateMenu(false, Lang:t('menu.admin_menu'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test1') -local menu2 = MenuV:CreateMenu(false, Lang:t('menu.admin_options'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test2') -local menu3 = MenuV:CreateMenu(false, Lang:t('menu.manage_server'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test3') -local menu4 = MenuV:CreateMenu(false, Lang:t('menu.online_players'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test4') -local menu5 = MenuV:CreateMenu(false, Lang:t('menu.vehicle_options'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test5') -local menu6 = MenuV:CreateMenu(false, Lang:t('menu.dealer_list'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test6') -local menu7 = MenuV:CreateMenu(false, Lang:t('menu.developer_options'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test7') +local menu1 = MenuV:CreateMenu(false, Lang:t('menu.admin_menu'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', + 'test1') +local menu2 = MenuV:CreateMenu(false, Lang:t('menu.admin_options'), menuLocation, 220, 20, 60, 'size-125', 'none', + 'menuv', 'test2') +local menu3 = MenuV:CreateMenu(false, Lang:t('menu.manage_server'), menuLocation, 220, 20, 60, 'size-125', 'none', + 'menuv', 'test3') +local menu4 = MenuV:CreateMenu(false, Lang:t('menu.online_players'), menuLocation, 220, 20, 60, 'size-125', 'none', + 'menuv', 'test4') +local menu5 = MenuV:CreateMenu(false, Lang:t('menu.vehicle_options'), menuLocation, 220, 20, 60, 'size-125', 'none', + 'menuv', 'test5') +local menu6 = MenuV:CreateMenu(false, Lang:t('menu.dealer_list'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', + 'test6') +local menu7 = MenuV:CreateMenu(false, Lang:t('menu.developer_options'), menuLocation, 220, 20, 60, 'size-125', 'none', + 'menuv', 'test7') --Sub Menus -local menu8 = MenuV:CreateMenu(false, Lang:t('menu.weather_conditions'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test8') +local menu8 = MenuV:CreateMenu(false, Lang:t('menu.weather_conditions'), menuLocation, 220, 20, 60, 'size-125', 'none', + 'menuv', 'test8') local menu9 = MenuV:CreateMenu(false, Lang:t('menu.ban'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test9') -local menu10 = MenuV:CreateMenu(false, Lang:t('menu.kick'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test10') -local menu11 = MenuV:CreateMenu(false, Lang:t('menu.permissions'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test11') -local menu12 = MenuV:CreateMenu(false, Lang:t('menu.vehicle_categories'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test12') -local menu13 = MenuV:CreateMenu(false, Lang:t('menu.vehicle_models'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test13') -local menu14 = MenuV:CreateMenu(false, Lang:t('menu.entity_view_options'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test14') -local menu15 = MenuV:CreateMenu(false, Lang:t('menu.spawn_weapons'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test15') +local menu10 = MenuV:CreateMenu(false, Lang:t('menu.kick'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', + 'test10') +local menu11 = MenuV:CreateMenu(false, Lang:t('menu.permissions'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', + 'test11') +local menu12 = MenuV:CreateMenu(false, Lang:t('menu.vehicle_categories'), menuLocation, 220, 20, 60, 'size-125', 'none', + 'menuv', 'test12') +local menu13 = MenuV:CreateMenu(false, Lang:t('menu.vehicle_models'), menuLocation, 220, 20, 60, 'size-125', 'none', + 'menuv', 'test13') +local menu14 = MenuV:CreateMenu(false, Lang:t('menu.entity_view_options'), menuLocation, 220, 20, 60, 'size-125', 'none', + 'menuv', 'test14') +local menu15 = MenuV:CreateMenu(false, Lang:t('menu.spawn_weapons'), menuLocation, 220, 20, 60, 'size-125', 'none', + 'menuv', 'test15') + +-- Vehicle Options Menu +local vehicleoptions_menu = MenuV:CreateMenu(false, Lang:t('menu.vehicle.vehicle_options'), menuLocation, 220, 20, 60, 'size-125', + 'template1', 'menuv', 'vehiclerelatedoption') +local vehicleoptions_mod_menu = MenuV:CreateMenu(false, Lang:t('menu.vehicle.modifications'), menuLocation, 220, 20, 60, 'size-125', + 'template1', + 'menuv', 'vehmodmenu') +local color_options_mod_menu = MenuV:CreateMenu(false, Lang:t('menu.vehicle.color_menu'), menuLocation, 220, 20, 60, 'size-125', + 'template1', 'menuv', 'vehmodmenucolor') +local classic_colors_mod_menu = MenuV:CreateMenu(false, Lang:t('menu.vehicle.classic_colors'), menuLocation, 220, 20, 60, 'size-125', + 'template1', 'menuv', 'vehmodmenuclasiccol') +local tyre_smoke_color_options = MenuV:CreateMenu(false, Lang:t('menu.vehicle.tyre_smoke_colors'), menuLocation, 255, 0, 0, + 'size-125', 'template1', 'menuv', 'vehmodmenutyrsmok') +local metal_color_options = MenuV:CreateMenu(false, Lang:t('menu.vehicle.metal_colors'), menuLocation, 220, 20, 60, 'size-125', + 'template1', 'menuv', 'vehmodmenumetalcol') +local matte_color_options = MenuV:CreateMenu(false, Lang:t('menu.vehicle.matte_colors'), menuLocation, 220, 20, 60, 'size-125', + 'template1', 'menuv', 'vehmodmenumattecol') +local neon_color_options = MenuV:CreateMenu(false, Lang:t('menu.vehicle.neon_options'), menuLocation, 220, 20, 60, 'size-125', + 'template1', 'menuv', 'vehmodmenuneon') RegisterNetEvent('qb-admin:client:openMenu', function() QBCore.Functions.TriggerCallback('qb-admin:isAdmin', function(isAdmin) @@ -285,6 +318,647 @@ local menu5_vehicles_max_upgrades = menu5:AddButton({ description = Lang:t('desc.max_mod_desc') }) +if VehicleMods.enabled then + menu5:AddButton({ + icon = '🚙', + label = Lang:t('menu.vehicle_moddings'), + value = 'vehicleoptions_menu', + description = Lang:t('desc.vehicle_moddings_desc'), + select = function(i) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + if veh ~= 0 then + MenuV:OpenMenu(vehicleoptions_menu) + else + QBCore.Functions.Notify(Lang:t('error.no_vehicle'), 'error', 5000) + end + end + }) +end + +--[[ + Vehicle Options +--]] + +color_options_mod_menu:AddButton({ + icon = '', + label = Lang:t('menu.vehicle.tyre_smoke_colors'), + value = tyre_smoke_color_options, + description = Lang:t('desc.vehicle.tyre_smoke_colors'), +}) + +color_options_mod_menu:AddButton({ + icon = '', + label = Lang:t('menu.vehicle.neon_options'), + value = neon_color_options, + description = Lang:t('desc.vehicle.neon_options'), +}) +color_options_mod_menu:AddButton({ + icon = '', + label = Lang:t('menu.vehicle.classic_colors'), + value = classic_colors_mod_menu, + description = Lang:t('desc.vehicle.classic_colors'), +}) +color_options_mod_menu:AddButton({ + icon = '', + label = Lang:t('menu.vehicle.matte_colors'), + value = matte_color_options, + description = Lang:t('desc.vehicle.matte_colors'), +}) + +color_options_mod_menu:AddButton({ + icon = '', + label = Lang:t('menu.vehicle.metal_colors'), + value = metal_color_options, + description = Lang:t('desc.vehicle.metal_colors'), +}) +local cp = color_options_mod_menu:AddCheckbox({ + icon = '', + label = Lang:t('menu.vehicle.primary_color'), + value = 'y', + description = Lang:t('desc.vehicle.primary_color'), +}) +local cs = color_options_mod_menu:AddCheckbox({ + icon = '', + label = Lang:t('menu.vehicle.secondary_color'), + value = 'n', + description = Lang:t('desc.vehicle.secondary_color'), +}) +local pearlescentc = color_options_mod_menu:AddCheckbox({ + icon = '', + label = Lang:t('menu.vehicle.pearlescent_color'), + value = 'n', + description = Lang:t('desc.vehicle.pearlescent_color'), +}) +local wheelc = color_options_mod_menu:AddCheckbox({ + icon = '', + label = Lang:t('menu.vehicle.wheel_color'), + value = 'n', + description = Lang:t('desc.vehicle.wheel_color'), +}) + +local dashc = color_options_mod_menu:AddCheckbox({ + icon = '', + label = Lang:t('menu.vehicle.dashboard_color'), + value = 'n', + description = Lang:t('desc.vehicle.dashboard_color'), +}) +local intc = color_options_mod_menu:AddCheckbox({ + icon = '', + label = Lang:t('menu.vehicle.interior_color'), + value = 'n', + description = Lang:t('desc.vehicle.interior_color'), +}) + +local neonfront = neon_color_options:AddCheckbox({ + icon = '', + label = Lang:t('menu.vehicle.enable_front_neon'), + value = 'n', + description = Lang:t('desc.vehicle.enable_front_neon'), +}) +local neonback = neon_color_options:AddCheckbox({ + icon = '', + label = Lang:t('menu.vehicle.enable_back_neon'), + value = 'n', + description = Lang:t('desc.vehicle.enable_back_neon'), +}) +local neonleft = neon_color_options:AddCheckbox({ + icon = '', + label = Lang:t('menu.vehicle.enable_left_neon'), + value = 'n', + description = Lang:t('desc.vehicle.enable_left_neon'), +}) +local neonright = neon_color_options:AddCheckbox({ + icon = '', + label = Lang:t('menu.vehicle.enable_right_neon'), + value = 'n', + description = Lang:t('desc.vehicle.enable_right_neon'), +}) + +local neoncolor = neon_color_options:AddSlider({ + icon = '', + label = Lang:t('menu.vehicle.neon_color'), + value = 'demo', + values = VehicleMods.neoncolors, + description = Lang:t('desc.vehicle.neon_color'), +}) + +neoncolor:On('select', function(item, value) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + SetVehicleNeonLightsColour(veh, value[1], value[2], value[3]) +end) +local modbuttons = {} +neonfront:On('check', function(item) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + SetVehicleNeonLightEnabled(veh, 2, true) +end) + +neonfront:On('uncheck', function(item) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + SetVehicleNeonLightEnabled(veh, 2, false) +end) +neonback:On('check', function(item) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + SetVehicleNeonLightEnabled(veh, 3, true) +end) + +neonback:On('uncheck', function(item) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + SetVehicleNeonLightEnabled(veh, 3, false) +end) +neonleft:On('check', function(item) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + SetVehicleNeonLightEnabled(veh, 0, true) +end) + +neonleft:On('uncheck', function(item) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + SetVehicleNeonLightEnabled(veh, 0, false) +end) +neonright:On('check', function(item) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + SetVehicleNeonLightEnabled(veh, 1, true) +end) + +neonright:On('uncheck', function(item) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + SetVehicleNeonLightEnabled(veh, 1, false) +end) +cp:On('check', function(item) + isPrimary = true +end) + +cp:On('uncheck', function(item) + isPrimary = false +end) +cs:On('check', function(item) + isSecondary = true +end) + +cs:On('uncheck', function(item) + isSecondary = false +end) +pearlescentc:On('check', function(item) + isPearlescent = true +end) + +pearlescentc:On('uncheck', function(item) + isPearlescent = false +end) +wheelc:On('check', function(item) + isWheel = true +end) + +wheelc:On('uncheck', function(item) + isWheel = false +end) +dashc:On('check', function(item) + isDash = true +end) + +dashc:On('uncheck', function(item) + isDash = false +end) +intc:On('check', function(item) + isInt = true +end) + +intc:On('uncheck', function(item) + isInt = false +end) + +local vehicleoptions_vehrelated_mod = vehicleoptions_menu:AddButton({ + + icon = '🚙', + label = Lang:t('menu.vehicle.modifications'), + value = 'vehicleoptions_menu', + description = Lang:t('desc.vehicle.modifications'), +}) +vehicleoptions_vehrelated_mod:On("select", function() + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + if veh ~= 0 then + tyre_smoke_color_options:ClearItems() + classic_colors_mod_menu:ClearItems() + matte_color_options:ClearItems() + metal_color_options:ClearItems() + vehicleoptions_mod_menu:ClearItems() + vehicleoptions_mod_menu:AddButton({ + icon = '', + label = Lang:t('menu.vehicle.vehicle_color'), + value = color_options_mod_menu, + description = Lang:t('desc.vehicle.vehicle_color'), + }) + + for k, v in pairs(VehicleMods.vehmods) do + if v.modType and type(v.modType) == 'number' then + if v.modType == 17 then + modbuttons[k] = vehicleoptions_mod_menu:AddCheckbox({ + icon = '', + label = v.label, + value = 'n', + description = v.label + }) + modbuttons[k]:On('check', function() + ToggleVehicleMod(veh, 18, true) + end) + + modbuttons[k]:On('uncheck', function() + ToggleVehicleMod(veh, 18, false) + end) + goto continue + end + SetVehicleModKit(veh, 0) + local max = GetNumVehicleMods(veh, v.modType) + if max ~= 0 then + local vehiclemod = GetVehicleMod(veh, v.modType) + if vehiclemod == -1 then + vehiclemod = 0 + else + vehiclemod = vehiclemod + 1 + end + modbuttons[k] = vehicleoptions_mod_menu:AddRange({ + icon = '', + label = v.label, + description = v.label, + min = 0, + max = max, + value = vehiclemod, + saveOnUpdate = true + }) + modbuttons[k]:On('select', function(item, newValue, oldValue) + local veh = GetVehiclePedIsIn(PlayerPedId(), false) + if veh ~= 0 then + if newValue == 0 then + SetVehicleMod(veh, v.modType, max, false) + else + SetVehicleMod(veh, v.modType, newValue - 1, false) + end + end + end) + end + elseif v.modType and v.modType == 'plateIndex' then + SetVehicleModKit(veh, 0) + local vehiclemod = GetVehicleNumberPlateTextIndex(veh) + modbuttons[k] = vehicleoptions_mod_menu:AddRange({ + icon = '', + label = v.label, + description = v.label, + min = 0, + max = 4, + value = vehiclemod, + saveOnUpdate = true + }) + modbuttons[k]:On('select', function(item, newValue, oldValue) + local veh = GetVehiclePedIsIn(PlayerPedId(), false) + if veh ~= 0 then + SetVehicleNumberPlateTextIndex(veh, newValue) + end + end) + elseif v.modType and v.modType == 'livery2' then + SetVehicleLivery(veh, 0) + local vehiclemod = GetVehicleLiveryCount(veh) + if vehiclemod ~= -1 then + modbuttons[k] = vehicleoptions_mod_menu:AddRange({ + icon = '', + label = v.label, + description = v.label, + min = 1, + max = vehiclemod, + value = 0, + saveOnUpdate = true + }) + modbuttons[k]:On('select', function(item, newValue, oldValue) + local veh = GetVehiclePedIsIn(PlayerPedId(), false) + if veh ~= 0 then + SetVehicleLivery(veh, newValue) + end + end) + end + end + ::continue:: + end + + modbuttons['xenon'] = vehicleoptions_mod_menu:AddRange({ + icon = '', + label = Lang:t('menu.vehicle.headlights_color'), + description = Lang:t('desc.vehicle.headlights_color'), + min = 0, + max = 12, + value = 0, + saveOnUpdate = true + }) + modbuttons['xenon']:On('select', function(item, newValue, oldValue) + local veh = GetVehiclePedIsUsing(PlayerPedId()) + + if veh ~= 0 then + ToggleVehicleMod(veh, 22, true) -- toggle xenon + SetVehicleHeadlightsColour(veh, newValue) + end + end) + modbuttons['windowtint'] = vehicleoptions_mod_menu:AddRange({ + icon = '', + label = Lang:t('menu.vehicle.window_tint'), + description = Lang:t('desc.vehicle.window_tint'), + min = 0, + max = GetNumVehicleWindowTints(), + value = GetVehicleWindowTint(GetVehiclePedIsUsing(PlayerPedId())), + saveOnUpdate = true + }) + modbuttons['windowtint']:On('select', function(item, newValue, oldValue) + local veh = GetVehiclePedIsUsing(PlayerPedId()) + + if veh ~= 0 then + SetVehicleWindowTint(veh, newValue) + end + end) + for k, v in ipairs(VehicleMods.colors) do + classic_colors_mod_menu:AddButton({ + icon = '', + label = v.name, + value = v.colorindex, + description = 'Apply ' .. v.name .. ' Color to vehicle', + select = function(i) + local ped = PlayerPedId() + veh = GetVehiclePedIsIn(ped, false) + if veh ~= 0 then + local vehcolorp, vehcolors = GetVehicleColours(veh) + local vehcolorperl, vehcolorwheel = GetVehicleExtraColours(veh) + if isPrimary then + SetVehicleColours(veh, v.colorindex, vehcolors) + end + if isSecondary then + vehcolorp, vehcolors = GetVehicleColours(veh) + vehcolorperl, vehcolorwheel = GetVehicleExtraColours(veh) + SetVehicleColours(veh, vehcolorp, v.colorindex) + end + if isWheel then + vehcolorp, vehcolors = GetVehicleColours(veh) + vehcolorperl, vehcolorwheel = GetVehicleExtraColours(veh) + SetVehicleExtraColours(veh, vehcolorp, v.colorindex) + end + if isDash then + SetVehicleDashboardColor(veh, v.colorindex) + end + if isInt then + SetVehicleInteriorColor(veh, v.colorindex) + end + if isPearlescent then + vehcolorp, vehcolors = GetVehicleColours(veh) + vehcolorperl, vehcolorwheel = GetVehicleExtraColours(veh) + SetVehicleExtraColours(veh, v.colorindex, vehcolorwheel) + end + end + end + }) + end + for k, v in ipairs(VehicleMods.tyrecolors) do + tyre_smoke_color_options:AddButton({ + icon = '', + label = v.name, + value = 'tyr', + description = 'Apply ' .. v.name .. ' Color to Tyre Smoke', + select = function(i) + local ped = PlayerPedId() + veh = GetVehiclePedIsIn(ped, false) + if veh ~= 0 then + ToggleVehicleMod(veh, 20, true) + SetVehicleTyreSmokeColor(veh, v.r, v.g, v.b) + end + end + }) + end + for k, v in ipairs(VehicleMods.mattecolors) do + matte_color_options:AddButton({ + icon = '', + label = v.name, + value = v.colorindex, + description = 'Apply ' .. v.name .. ' Color to vehicle', + select = function(i) + local ped = PlayerPedId() + veh = GetVehiclePedIsIn(ped, false) + if veh ~= 0 then + local vehcolorp, vehcolors = GetVehicleColours(veh) + if isPrimary and not isSecondary then + SetVehicleColours(veh, v.colorindex, vehcolors) + elseif isSecondary and not isPrimary then + SetVehicleColours(veh, vehcolorp, v.colorindex) + else + SetVehicleColours(veh, v.colorindex, v.colorindex) + end + end + end + }) + end + for k, v in ipairs(VehicleMods.metalcolors) do + metal_color_options:AddButton({ + icon = '', + label = v.name, + value = v.colorindex, + description = 'Apply ' .. v.name .. ' Color to vehicle', + select = function(i) + local ped = PlayerPedId() + veh = GetVehiclePedIsIn(ped, false) + if veh ~= 0 then + local vehcolorp, vehcolors = GetVehicleColours(veh) + if isPrimary and not isSecondary then + SetVehicleColours(veh, v.colorindex, vehcolors) + elseif isSecondary and not isPrimary then + SetVehicleColours(veh, vehcolorp, v.colorindex) + else + SetVehicleColours(veh, v.colorindex, v.colorindex) + end + end + end + }) + end + for extraID = 0, 20 do + if DoesExtraExist(veh, extraID) then + modbuttons['extra' .. extraID] = vehicleoptions_mod_menu:AddCheckbox({ + icon = '', + label = 'Extra ' .. extraID, + description = 'Extra', + value = 'n' + }) + modbuttons['extra' .. extraID]:On('check', function(item) + SetVehicleExtra(veh, extraID, 0) + end) + + modbuttons['extra' .. extraID]:On('uncheck', function(item) + SetVehicleExtra(veh, extraID, 1) + end) + end + end + MenuV:OpenMenu(vehicleoptions_mod_menu) + else + QBCore.Functions.Notify(Lang:t('error.no_vehicle'), 'error', 5000) + end +end) + +--[[ + Toggle Engine +--]] +local vehicleoptions_toggle_engine = vehicleoptions_menu:AddCheckbox({ + icon = '🚧', + label = Lang:t('menu.vehicle.toggle_engine'), + description = Lang:t('desc.vehicle.toggle_engine'), + value = 'y' +}) + +vehicleoptions_toggle_engine:On('check', function(item) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + SetVehicleEngineOn(veh, true, true, true) +end) + +vehicleoptions_toggle_engine:On('uncheck', function(item) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + SetVehicleEngineOn(veh, false, true, true) +end) + +--[[ + Change Numberplate +--]] +vehicleoptions_menu:AddButton({ + icon = '⌨️', + label = Lang:t('menu.vehicle.change_numberplate'), + description = Lang:t('desc.vehicle.change_numberplate'), + value = "numbertext", + false, + select = function(i) + -- Open QBCore input dialog + local input = exports['qb-input']:ShowInput({ + header = Lang:t('menu.vehicle.change_numberplate'), + submitText = Lang:t('menu.change'), + inputs = { + { + text = Lang:t('menu.vehicle.enter_new_plate'), -- Label for input + name = "plate", -- Name used for input reference + type = "text", -- Input type + isRequired = true, -- Require the input to be filled + min = 1, -- Minimum character limit + max = 8 -- Maximum character limit + } + } + }) + + -- Check if input exists and is valid + if input and input.plate then + local newPlate = input.plate:upper() -- Convert plate text to uppercase + local ped = PlayerPedId() + local vehicle = GetVehiclePedIsIn(ped, false) + + if vehicle ~= 0 then + SetVehicleNumberPlateText(vehicle, newPlate) + TriggerEvent('QBCore:Notify', Lang:t('success.plate_changed_to', { plate = newPlate }), "success") + else + TriggerEvent('QBCore:Notify', Lang:t('error.no_vehicle'), "error") + end + else + TriggerEvent('QBCore:Notify', Lang:t('error.no_plate_text'), "error") + end + end +}) + +--[[ + Toggle Doors +--]] +local vehicledoor = {} +local vehicleoptions_toggledoor = vehicleoptions_menu:AddSlider({ + icon = '🚗', + label = Lang:t('menu.vehicle.toggle_doors'), + description = Lang:t('desc.vehicle.toggle_doors'), + value = 0, + values = VehicleMods.vehicledoors +}) +vehicleoptions_toggledoor:On('select', function(item, value) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + if veh then + if vehicledoor[veh] and vehicledoor[veh][value] then + SetVehicleDoorShut(veh, value, false) + vehicledoor[veh][value] = false + else + SetVehicleDoorOpen(veh, value, false) + vehicledoor[veh] = { veh } + vehicledoor[veh][value] = true + end + end +end) + +--[[ + Flip Vehicle +--]] +vehicleoptions_menu:AddButton({ + icon = '🚗', + label = Lang:t('menu.vehicle.flip_vehicle'), + value = 'n', + description = Lang:t('desc.vehicle.flip_vehicle'), + select = function(i) + local ped = PlayerPedId() + local veh = GetVehiclePedIsIn(ped, false) + SetVehicleOnGroundProperly(veh) + end +}) + +--[[ + Delete Vehicle +--]] +vehicleoptions_menu:AddButton({ + icon = '🚗', + label = Lang:t('menu.vehicle.delete_vehicle'), + value = 'n', + description = Lang:t('desc.vehicle.delete_vehicle'), + select = function(i) + ExecuteCommand('dv') + end +}) + +--[[ + Repair Vehicle +--]] +vehicleoptions_menu:AddButton({ + icon = '🛠', + label = Lang:t('menu.vehicle.repair_vehicle'), + description = Lang:t('desc.vehicle.repair_vehicle'), + value = "repairveh", + false, + select = function(i) + local veh = GetVehiclePedIsIn(PlayerPedId(), false) + if veh ~= 0 then + SetVehicleFixed(veh) + SetVehicleDeformationFixed(veh) + end + end +}) + +--[[ + Wash Vehicle +--]] +vehicleoptions_menu:AddButton({ + icon = '🚿', + label = Lang:t('menu.vehicle.wash_vehicle'), + description = Lang:t('desc.vehicle.wash_vehicle'), + value = "washveh", + false, + select = function(i) + local veh = GetVehiclePedIsIn(PlayerPedId(), false) + if veh ~= 0 then + SetVehicleDirtLevel(veh, 0.0) + end + end +}) + -- Developer Options Menu Buttons local menu7_dev_copy_vec3 = menu7:AddButton({ icon = '📋', diff --git a/fxmanifest.lua b/fxmanifest.lua index cff7790..819d436 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -10,7 +10,8 @@ ui_page 'html/index.html' shared_scripts { '@qb-core/shared/locale.lua', 'locales/en.lua', - 'locales/*.lua' + 'locales/*.lua', + 'shared/vehicles.lua', } client_scripts { From 88a510d237a4606294526a46839aa3e66371c826 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Sun, 17 Nov 2024 15:53:35 +0530 Subject: [PATCH 06/15] Fixed lint issues. --- client/client.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/client/client.lua b/client/client.lua index de55ce6..a9d986a 100644 --- a/client/client.lua +++ b/client/client.lua @@ -596,7 +596,7 @@ vehicleoptions_vehrelated_mod:On("select", function() saveOnUpdate = true }) modbuttons[k]:On('select', function(item, newValue, oldValue) - local veh = GetVehiclePedIsIn(PlayerPedId(), false) + veh = GetVehiclePedIsIn(PlayerPedId(), false) if veh ~= 0 then if newValue == 0 then SetVehicleMod(veh, v.modType, max, false) @@ -619,7 +619,7 @@ vehicleoptions_vehrelated_mod:On("select", function() saveOnUpdate = true }) modbuttons[k]:On('select', function(item, newValue, oldValue) - local veh = GetVehiclePedIsIn(PlayerPedId(), false) + veh = GetVehiclePedIsIn(PlayerPedId(), false) if veh ~= 0 then SetVehicleNumberPlateTextIndex(veh, newValue) end @@ -638,7 +638,7 @@ vehicleoptions_vehrelated_mod:On("select", function() saveOnUpdate = true }) modbuttons[k]:On('select', function(item, newValue, oldValue) - local veh = GetVehiclePedIsIn(PlayerPedId(), false) + veh = GetVehiclePedIsIn(PlayerPedId(), false) if veh ~= 0 then SetVehicleLivery(veh, newValue) end @@ -658,7 +658,7 @@ vehicleoptions_vehrelated_mod:On("select", function() saveOnUpdate = true }) modbuttons['xenon']:On('select', function(item, newValue, oldValue) - local veh = GetVehiclePedIsUsing(PlayerPedId()) + veh = GetVehiclePedIsUsing(PlayerPedId()) if veh ~= 0 then ToggleVehicleMod(veh, 22, true) -- toggle xenon @@ -675,35 +675,35 @@ vehicleoptions_vehrelated_mod:On("select", function() saveOnUpdate = true }) modbuttons['windowtint']:On('select', function(item, newValue, oldValue) - local veh = GetVehiclePedIsUsing(PlayerPedId()) + veh = GetVehiclePedIsUsing(PlayerPedId()) if veh ~= 0 then SetVehicleWindowTint(veh, newValue) end end) - for k, v in ipairs(VehicleMods.colors) do + for _, v in ipairs(VehicleMods.colors) do classic_colors_mod_menu:AddButton({ icon = '', label = v.name, value = v.colorindex, description = 'Apply ' .. v.name .. ' Color to vehicle', select = function(i) - local ped = PlayerPedId() + ped = PlayerPedId() veh = GetVehiclePedIsIn(ped, false) if veh ~= 0 then local vehcolorp, vehcolors = GetVehicleColours(veh) - local vehcolorperl, vehcolorwheel = GetVehicleExtraColours(veh) + local _, vehcolorwheel = GetVehicleExtraColours(veh) if isPrimary then SetVehicleColours(veh, v.colorindex, vehcolors) end if isSecondary then vehcolorp, vehcolors = GetVehicleColours(veh) - vehcolorperl, vehcolorwheel = GetVehicleExtraColours(veh) + _, vehcolorwheel = GetVehicleExtraColours(veh) SetVehicleColours(veh, vehcolorp, v.colorindex) end if isWheel then vehcolorp, vehcolors = GetVehicleColours(veh) - vehcolorperl, vehcolorwheel = GetVehicleExtraColours(veh) + _, vehcolorwheel = GetVehicleExtraColours(veh) SetVehicleExtraColours(veh, vehcolorp, v.colorindex) end if isDash then @@ -714,14 +714,14 @@ vehicleoptions_vehrelated_mod:On("select", function() end if isPearlescent then vehcolorp, vehcolors = GetVehicleColours(veh) - vehcolorperl, vehcolorwheel = GetVehicleExtraColours(veh) + _, vehcolorwheel = GetVehicleExtraColours(veh) SetVehicleExtraColours(veh, v.colorindex, vehcolorwheel) end end end }) end - for k, v in ipairs(VehicleMods.tyrecolors) do + for _, v in ipairs(VehicleMods.tyrecolors) do tyre_smoke_color_options:AddButton({ icon = '', label = v.name, @@ -737,7 +737,7 @@ vehicleoptions_vehrelated_mod:On("select", function() end }) end - for k, v in ipairs(VehicleMods.mattecolors) do + for _, v in ipairs(VehicleMods.mattecolors) do matte_color_options:AddButton({ icon = '', label = v.name, From a39d3849a9608950d9572cf37b1b908331459584 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Sun, 17 Nov 2024 15:59:27 +0530 Subject: [PATCH 07/15] Fixed lint issues. --- client/client.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/client.lua b/client/client.lua index a9d986a..278ab8d 100644 --- a/client/client.lua +++ b/client/client.lua @@ -493,6 +493,7 @@ neonright:On('uncheck', function(item) local veh = GetVehiclePedIsIn(ped, false) SetVehicleNeonLightEnabled(veh, 1, false) end) +local isPrimary, isSecondary, isPearlescent = nil, nil, nil cp:On('check', function(item) isPrimary = true end) @@ -690,8 +691,9 @@ vehicleoptions_vehrelated_mod:On("select", function() select = function(i) ped = PlayerPedId() veh = GetVehiclePedIsIn(ped, false) + local vehcolors, vehcolorp = nil, nil if veh ~= 0 then - local vehcolorp, vehcolors = GetVehicleColours(veh) + vehcolorp, vehcolors = GetVehicleColours(veh) local _, vehcolorwheel = GetVehicleExtraColours(veh) if isPrimary then SetVehicleColours(veh, v.colorindex, vehcolors) From 26c2f8e518a5ff88fbe11ff04a2b9d2863859d52 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Sun, 17 Nov 2024 16:00:20 +0530 Subject: [PATCH 08/15] Fixed lint issues. --- client/client.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/client.lua b/client/client.lua index 278ab8d..b85a0c4 100644 --- a/client/client.lua +++ b/client/client.lua @@ -730,7 +730,7 @@ vehicleoptions_vehrelated_mod:On("select", function() value = 'tyr', description = 'Apply ' .. v.name .. ' Color to Tyre Smoke', select = function(i) - local ped = PlayerPedId() + ped = PlayerPedId() veh = GetVehiclePedIsIn(ped, false) if veh ~= 0 then ToggleVehicleMod(veh, 20, true) @@ -746,7 +746,7 @@ vehicleoptions_vehrelated_mod:On("select", function() value = v.colorindex, description = 'Apply ' .. v.name .. ' Color to vehicle', select = function(i) - local ped = PlayerPedId() + ped = PlayerPedId() veh = GetVehiclePedIsIn(ped, false) if veh ~= 0 then local vehcolorp, vehcolors = GetVehicleColours(veh) From bc2e280649f014eb02eea2248b2132718ac4c31b Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Sun, 17 Nov 2024 16:04:08 +0530 Subject: [PATCH 09/15] Fixed lint issues. --- client/client.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/client.lua b/client/client.lua index b85a0c4..6a76486 100644 --- a/client/client.lua +++ b/client/client.lua @@ -493,7 +493,7 @@ neonright:On('uncheck', function(item) local veh = GetVehiclePedIsIn(ped, false) SetVehicleNeonLightEnabled(veh, 1, false) end) -local isPrimary, isSecondary, isPearlescent = nil, nil, nil +local isPrimary, isSecondary, isPearlescent, isWheel, isDash, isInt = nil, nil, nil, nil, nil, nil cp:On('check', function(item) isPrimary = true end) @@ -761,14 +761,14 @@ vehicleoptions_vehrelated_mod:On("select", function() end }) end - for k, v in ipairs(VehicleMods.metalcolors) do + for _, v in ipairs(VehicleMods.metalcolors) do metal_color_options:AddButton({ icon = '', label = v.name, value = v.colorindex, description = 'Apply ' .. v.name .. ' Color to vehicle', select = function(i) - local ped = PlayerPedId() + ped = PlayerPedId() veh = GetVehiclePedIsIn(ped, false) if veh ~= 0 then local vehcolorp, vehcolors = GetVehicleColours(veh) From 4e13942bfa621f8729c5b1ea7a50dbb15f5da4c3 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Sun, 17 Nov 2024 16:06:17 +0530 Subject: [PATCH 10/15] Fixed lint issues. --- client/client.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/client/client.lua b/client/client.lua index 6a76486..9566c05 100644 --- a/client/client.lua +++ b/client/client.lua @@ -693,19 +693,16 @@ vehicleoptions_vehrelated_mod:On("select", function() veh = GetVehiclePedIsIn(ped, false) local vehcolors, vehcolorp = nil, nil if veh ~= 0 then - vehcolorp, vehcolors = GetVehicleColours(veh) - local _, vehcolorwheel = GetVehicleExtraColours(veh) + _, vehcolors = GetVehicleColours(veh) if isPrimary then SetVehicleColours(veh, v.colorindex, vehcolors) end if isSecondary then - vehcolorp, vehcolors = GetVehicleColours(veh) - _, vehcolorwheel = GetVehicleExtraColours(veh) + vehcolorp, _ = GetVehicleColours(veh) SetVehicleColours(veh, vehcolorp, v.colorindex) end if isWheel then - vehcolorp, vehcolors = GetVehicleColours(veh) - _, vehcolorwheel = GetVehicleExtraColours(veh) + vehcolorp, _ = GetVehicleColours(veh) SetVehicleExtraColours(veh, vehcolorp, v.colorindex) end if isDash then @@ -715,7 +712,6 @@ vehicleoptions_vehrelated_mod:On("select", function() SetVehicleInteriorColor(veh, v.colorindex) end if isPearlescent then - vehcolorp, vehcolors = GetVehicleColours(veh) _, vehcolorwheel = GetVehicleExtraColours(veh) SetVehicleExtraColours(veh, v.colorindex, vehcolorwheel) end From bb51dccdd6d5222d15c7d3296affb212d8364981 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Sun, 17 Nov 2024 16:08:53 +0530 Subject: [PATCH 11/15] Fixed lint issues. --- client/client.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/client.lua b/client/client.lua index 9566c05..c66ac28 100644 --- a/client/client.lua +++ b/client/client.lua @@ -691,18 +691,17 @@ vehicleoptions_vehrelated_mod:On("select", function() select = function(i) ped = PlayerPedId() veh = GetVehiclePedIsIn(ped, false) - local vehcolors, vehcolorp = nil, nil if veh ~= 0 then - _, vehcolors = GetVehicleColours(veh) if isPrimary then + local _, vehcolors = GetVehicleColours(veh) SetVehicleColours(veh, v.colorindex, vehcolors) end if isSecondary then - vehcolorp, _ = GetVehicleColours(veh) + local vehcolorp, _ = GetVehicleColours(veh) SetVehicleColours(veh, vehcolorp, v.colorindex) end if isWheel then - vehcolorp, _ = GetVehicleColours(veh) + local vehcolorp, _ = GetVehicleColours(veh) SetVehicleExtraColours(veh, vehcolorp, v.colorindex) end if isDash then @@ -712,7 +711,7 @@ vehicleoptions_vehrelated_mod:On("select", function() SetVehicleInteriorColor(veh, v.colorindex) end if isPearlescent then - _, vehcolorwheel = GetVehicleExtraColours(veh) + local _, vehcolorwheel = GetVehicleExtraColours(veh) SetVehicleExtraColours(veh, v.colorindex, vehcolorwheel) end end From 3285209a6e2279a0f089909973f62c830a1e2c42 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Sun, 17 Nov 2024 16:44:43 +0530 Subject: [PATCH 12/15] Fixed wheel mod bug and removed price from config. --- client/client.lua | 60 +++++++++++++++---------------- shared/vehicles.lua | 87 --------------------------------------------- 2 files changed, 30 insertions(+), 117 deletions(-) diff --git a/client/client.lua b/client/client.lua index c66ac28..8672a69 100644 --- a/client/client.lua +++ b/client/client.lua @@ -576,36 +576,37 @@ vehicleoptions_vehrelated_mod:On("select", function() modbuttons[k]:On('uncheck', function() ToggleVehicleMod(veh, 18, false) end) - goto continue - end - SetVehicleModKit(veh, 0) - local max = GetNumVehicleMods(veh, v.modType) - if max ~= 0 then - local vehiclemod = GetVehicleMod(veh, v.modType) - if vehiclemod == -1 then - vehiclemod = 0 - else - vehiclemod = vehiclemod + 1 - end - modbuttons[k] = vehicleoptions_mod_menu:AddRange({ - icon = '', - label = v.label, - description = v.label, - min = 0, - max = max, - value = vehiclemod, - saveOnUpdate = true - }) - modbuttons[k]:On('select', function(item, newValue, oldValue) - veh = GetVehiclePedIsIn(PlayerPedId(), false) - if veh ~= 0 then - if newValue == 0 then - SetVehicleMod(veh, v.modType, max, false) - else - SetVehicleMod(veh, v.modType, newValue - 1, false) - end + else + SetVehicleModKit(veh, 0) + local max = GetNumVehicleMods(veh, v.modType) + if max ~= 0 then + local vehiclemod = GetVehicleMod(veh, v.modType) + if vehiclemod == -1 then + vehiclemod = 0 + else + vehiclemod = vehiclemod + 1 end - end) + modbuttons[k] = vehicleoptions_mod_menu:AddRange({ + icon = '', + label = v.label, + description = v.label, + min = 0, + max = max, + value = vehiclemod, + saveOnUpdate = true + }) + modbuttons[k]:On('select', function(item, newValue, oldValue) + veh = GetVehiclePedIsIn(PlayerPedId(), false) + SetVehicleWheelType(veh, v.wheelType) + if veh ~= 0 then + if newValue == 0 then + SetVehicleMod(veh, v.modType, max, false) + else + SetVehicleMod(veh, v.modType, newValue - 1, false) + end + end + end) + end end elseif v.modType and v.modType == 'plateIndex' then SetVehicleModKit(veh, 0) @@ -646,7 +647,6 @@ vehicleoptions_vehrelated_mod:On("select", function() end) end end - ::continue:: end modbuttons['xenon'] = vehicleoptions_mod_menu:AddRange({ diff --git a/shared/vehicles.lua b/shared/vehicles.lua index 5b73083..2d5f634 100644 --- a/shared/vehicles.lua +++ b/shared/vehicles.lua @@ -639,386 +639,299 @@ VehicleMods.vehmods = { label = "Turbo", parent = "upgrades", modType = 17, - price = { - 55.81 - } }, modEngine = { label = "Engine", parent = "upgrades", modType = 11, - price = { - 13.95, - 32.56, - 65.12, - 139.53 - } }, modBrakes = { label = "Brakes", parent = "upgrades", modType = 12, - price = { - 4.65, - 9.3, - 18.6, - 13.95 - } }, modTransmission = { label = "Transmission", parent = "upgrades", modType = 13, - price = { - 13.95, - 20.93, - 46.51 - } }, modSuspension = { label = "Suspension", parent = "upgrades", modType = 15, - price = { - 3.72, - 7.44, - 14.88, - 29.77, - 40.2 - } }, modArmor = { label = "Armor", parent = "upgrades", modType = 16, - price = { - 69.77, - 116.28, - 130, - 150, - 180, - 190 - } }, modPlateHolder = { label = "Plate - Back", parent = "cosmetics", modType = 25, - price = 3.49 }, modVanityPlate = { label = "Plate - Front", parent = "cosmetics", modType = 26, - price = 1.1 }, modTrimA = { label = "Interior", parent = "cosmetics", modType = 27, - price = 6.98 }, modOrnaments = { label = "Trim", parent = "cosmetics", modType = 28, - price = 0.9 }, modDashboard = { label = "Dashboard", parent = "cosmetics", modType = 29, - price = 4.65 }, modDial = { label = "Speedometer", parent = "cosmetics", modType = 30, - price = 4.19 }, modDoorSpeaker = { label = "Door Speakers", parent = "cosmetics", modType = 31, - price = 5.58 }, modSeats = { label = "Seats", parent = "cosmetics", modType = 32, - price = 4.65 }, modSteeringWheel = { label = "Steering Wheel", parent = "cosmetics", modType = 33, - price = 4.19 }, modShifterLeavers = { label = "Gear Lever", parent = "cosmetics", modType = 34, - price = 3.26 }, modAPlate = { label = "Quarter-Deck", parent = "cosmetics", modType = 35, - price = 4.19 }, modSpeakers = { label = "Speakers", parent = "cosmetics", modType = 36, - price = 6.98 }, modTrunk = { label = "Trunk", parent = "cosmetics", modType = 37, - price = 5.58 }, modHydrolic = { label = "Hydraulic", parent = "cosmetics", modType = 38, - price = 5.12 }, modEngineBlock = { label = "Engine Block", parent = "cosmetics", modType = 39, - price = 5.12 }, modAirFilter = { label = "Air Filter", parent = "cosmetics", modType = 40, - price = 3.72 }, modStruts = { label = "Struts", parent = "cosmetics", modType = 41, - price = 6.51 }, modArchCover = { label = "Arch Cover", parent = "cosmetics", modType = 42, - price = 4.19 }, modAerials = { label = "Aerials", parent = "cosmetics", modType = 43, - price = 1.12 }, modTrimB = { label = "Wings", parent = "cosmetics", modType = 44, - price = 6.05 }, modTank = { label = "Fuel Tank", parent = "cosmetics", modType = 45, - price = 4.19 }, modWindows = { label = "Windows", parent = "cosmetics", modType = 46, - price = 4.19 }, modLivery = { label = "Stickers", parent = "cosmetics", modType = 48, - price = 9.3 }, modFrontWheelsType0 = { label = "Sport", parent = "modFrontWheelsTypes", modType = 23, wheelType = 0, - price = 4.65 }, modFrontWheelsType1 = { label = "Muscle", parent = "modFrontWheelsTypes", modType = 23, wheelType = 1, - price = 4.19 }, modFrontWheelsType2 = { label = "Low Rider", parent = "modFrontWheelsTypes", modType = 23, wheelType = 2, - price = 4.65 }, modFrontWheelsType3 = { label = "SUV", parent = "modFrontWheelsTypes", modType = 23, wheelType = 3, - price = 4.19 }, modFrontWheelsType4 = { label = "All Terrain", parent = "modFrontWheelsTypes", modType = 23, wheelType = 4, - price = 4.19 }, modFrontWheelsType5 = { label = "Tuning", parent = "modFrontWheelsTypes", modType = 23, wheelType = 5, - price = 5.12 }, modFrontWheelsType6 = { label = "Motorcycle", parent = "modFrontWheelsTypes", modType = 23, wheelType = 6, - price = 3.26 }, modFrontWheelsType7 = { label = "Highend", parent = "modFrontWheelsTypes", modType = 23, wheelType = 7, - price = 5.12 }, wheelColor = { label = "Wheel Color", parent = "modFrontWheelsColor", modType = "wheelColor", - price = 0.66 }, plateIndex = { label = "License Plates", parent = "cosmetics", modType = "plateIndex", - price = 1.1 }, color1 = { label = "Primary Color", parent = "primaryRespray", modType = "color1", - price = 1.12 }, color2 = { label = "Secondary Color", parent = "secondaryRespray", modType = "color2", - price = 0.66 }, pearlescentColor = { label = "Pearlescent Color", parent = "pearlescentRespray", modType = "pearlescentColor", - price = 0.88 }, modXenon = { label = "Headlight", parent = "cosmetics", modType = 22, - price = 3.72 }, modSpoilers = { label = "Spoilers", parent = "bodyparts", modType = 0, - price = 4.65 }, modFrontBumper = { label = "Front Bumper", parent = "bodyparts", modType = 1, - price = 5.12 }, modRearBumper = { label = "Rear Bumper", parent = "bodyparts", modType = 2, - price = 5.12 }, modSideSkirt = { label = "Sideskirt", parent = "bodyparts", modType = 3, - price = 4.65 }, modExhaust = { label = "Exhaust", parent = "bodyparts", modType = 4, - price = 5.12 }, modFrame = { label = "Cage", parent = "bodyparts", modType = 5, - price = 5.12 }, modGrille = { label = "Grille", parent = "bodyparts", modType = 6, - price = 3.72 }, modHood = { label = "Hood", parent = "bodyparts", modType = 7, - price = 4.88 }, modFender = { label = "Left Fender", parent = "bodyparts", modType = 8, - price = 5.12 }, modRightFender = { label = "Right Fender", parent = "bodyparts", modType = 9, - price = 5.12 }, modRoof = { label = "Roof", parent = "bodyparts", modType = 10, - price = 5.58 }, modHorns = { label = "Horns", parent = "cosmetics", modType = 14, - price = 1.12 }, neonColor = { label = "Neon", parent = "cosmetics", modType = "neonColor", - price = 1.12 }, tyreSmokeColor = { label = "Tiresmoke", parent = "wheels", modType = "tyreSmokeColor", - price = 1.12 }, modSticker = { label = "Livery 2", parent = "cosmetics", modType = "livery2", - price = 9.3 } }; VehicleMods.vehicledoors = { From 6c8055713edd8df0b896bbedf526eabc18b7ad70 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Sun, 17 Nov 2024 17:14:01 +0530 Subject: [PATCH 13/15] Fixed bugs related to wheels. --- client/client.lua | 8 ++- shared/vehicles.lua | 146 ++++++++++++++++++++++++++------------------ 2 files changed, 94 insertions(+), 60 deletions(-) diff --git a/client/client.lua b/client/client.lua index 8672a69..610b413 100644 --- a/client/client.lua +++ b/client/client.lua @@ -560,7 +560,7 @@ vehicleoptions_vehrelated_mod:On("select", function() description = Lang:t('desc.vehicle.vehicle_color'), }) - for k, v in pairs(VehicleMods.vehmods) do + for k, v in ipairs(VehicleMods.vehmods) do if v.modType and type(v.modType) == 'number' then if v.modType == 17 then modbuttons[k] = vehicleoptions_mod_menu:AddCheckbox({ @@ -586,9 +586,13 @@ vehicleoptions_vehrelated_mod:On("select", function() else vehiclemod = vehiclemod + 1 end + local labelPrefix = '' + if v.modType == 23 then + labelPrefix = 'Wheel - ' + end modbuttons[k] = vehicleoptions_mod_menu:AddRange({ icon = '', - label = v.label, + label = labelPrefix .. v.label, description = v.label, min = 0, max = max, diff --git a/shared/vehicles.lua b/shared/vehicles.lua index 2d5f634..03904a8 100644 --- a/shared/vehicles.lua +++ b/shared/vehicles.lua @@ -635,300 +635,330 @@ VehicleMods.neoncolors = { } }; VehicleMods.vehmods = { - modTurbo = { + { label = "Turbo", parent = "upgrades", modType = 17, }, - modEngine = { + { label = "Engine", parent = "upgrades", modType = 11, }, - modBrakes = { + { label = "Brakes", parent = "upgrades", modType = 12, }, - modTransmission = { + { label = "Transmission", parent = "upgrades", modType = 13, }, - modSuspension = { + { label = "Suspension", parent = "upgrades", modType = 15, }, - modArmor = { + { label = "Armor", parent = "upgrades", modType = 16, }, - modPlateHolder = { + { label = "Plate - Back", parent = "cosmetics", modType = 25, }, - modVanityPlate = { + { label = "Plate - Front", parent = "cosmetics", modType = 26, }, - modTrimA = { + { label = "Interior", parent = "cosmetics", modType = 27, }, - modOrnaments = { + { label = "Trim", parent = "cosmetics", modType = 28, }, - modDashboard = { + { label = "Dashboard", parent = "cosmetics", modType = 29, }, - modDial = { + { label = "Speedometer", parent = "cosmetics", modType = 30, }, - modDoorSpeaker = { + { label = "Door Speakers", parent = "cosmetics", modType = 31, }, - modSeats = { + { label = "Seats", parent = "cosmetics", modType = 32, }, - modSteeringWheel = { + { label = "Steering Wheel", parent = "cosmetics", modType = 33, }, - modShifterLeavers = { + { label = "Gear Lever", parent = "cosmetics", modType = 34, }, - modAPlate = { + { label = "Quarter-Deck", parent = "cosmetics", modType = 35, }, - modSpeakers = { + { label = "Speakers", parent = "cosmetics", modType = 36, }, - modTrunk = { + { label = "Trunk", parent = "cosmetics", modType = 37, }, - modHydrolic = { + { label = "Hydraulic", parent = "cosmetics", modType = 38, }, - modEngineBlock = { + { label = "Engine Block", parent = "cosmetics", modType = 39, }, - modAirFilter = { + { label = "Air Filter", parent = "cosmetics", modType = 40, }, - modStruts = { + { label = "Struts", parent = "cosmetics", modType = 41, }, - modArchCover = { + { label = "Arch Cover", parent = "cosmetics", modType = 42, }, - modAerials = { + { label = "Aerials", parent = "cosmetics", modType = 43, }, - modTrimB = { + { label = "Wings", parent = "cosmetics", modType = 44, }, - modTank = { + { label = "Fuel Tank", parent = "cosmetics", modType = 45, }, - modWindows = { + { label = "Windows", parent = "cosmetics", modType = 46, }, - modLivery = { + { label = "Stickers", parent = "cosmetics", modType = 48, }, - modFrontWheelsType0 = { + { label = "Sport", parent = "modFrontWheelsTypes", modType = 23, wheelType = 0, }, - modFrontWheelsType1 = { + { label = "Muscle", parent = "modFrontWheelsTypes", modType = 23, wheelType = 1, }, - modFrontWheelsType2 = { + { label = "Low Rider", parent = "modFrontWheelsTypes", modType = 23, wheelType = 2, }, - modFrontWheelsType3 = { + { label = "SUV", parent = "modFrontWheelsTypes", modType = 23, wheelType = 3, }, - modFrontWheelsType4 = { + { label = "All Terrain", parent = "modFrontWheelsTypes", modType = 23, wheelType = 4, }, - modFrontWheelsType5 = { + { label = "Tuning", parent = "modFrontWheelsTypes", modType = 23, wheelType = 5, }, - modFrontWheelsType6 = { + { label = "Motorcycle", parent = "modFrontWheelsTypes", modType = 23, wheelType = 6, }, - modFrontWheelsType7 = { + { label = "Highend", parent = "modFrontWheelsTypes", modType = 23, wheelType = 7, }, - wheelColor = { + { + label = "Original", + parent = "modFrontWheelsTypes", + modType = 23, + wheelType = 8, + }, + { + label = "Bespoke", + parent = "modFrontWheelsTypes", + modType = 23, + wheelType = 9, + }, + { + label = "Open Wheel", + parent = "modFrontWheelsTypes", + modType = 23, + wheelType = 10, + }, + { + label = "Street", + parent = "modFrontWheelsTypes", + modType = 23, + wheelType = 11, + }, + { + label = "Track", + parent = "modFrontWheelsTypes", + modType = 23, + wheelType = 12, + }, + { label = "Wheel Color", parent = "modFrontWheelsColor", modType = "wheelColor", }, - plateIndex = { + { label = "License Plates", parent = "cosmetics", modType = "plateIndex", }, - color1 = { + { label = "Primary Color", parent = "primaryRespray", modType = "color1", }, - color2 = { + { label = "Secondary Color", parent = "secondaryRespray", modType = "color2", }, - pearlescentColor = { + { label = "Pearlescent Color", parent = "pearlescentRespray", modType = "pearlescentColor", }, - modXenon = { + { label = "Headlight", parent = "cosmetics", modType = 22, }, - modSpoilers = { + { label = "Spoilers", parent = "bodyparts", modType = 0, }, - modFrontBumper = { + { label = "Front Bumper", parent = "bodyparts", modType = 1, }, - modRearBumper = { + { label = "Rear Bumper", parent = "bodyparts", modType = 2, }, - modSideSkirt = { + { label = "Sideskirt", parent = "bodyparts", modType = 3, }, - modExhaust = { + { label = "Exhaust", parent = "bodyparts", modType = 4, }, - modFrame = { + { label = "Cage", parent = "bodyparts", modType = 5, }, - modGrille = { + { label = "Grille", parent = "bodyparts", modType = 6, }, - modHood = { + { label = "Hood", parent = "bodyparts", modType = 7, }, - modFender = { + { label = "Left Fender", parent = "bodyparts", modType = 8, }, - modRightFender = { + { label = "Right Fender", parent = "bodyparts", modType = 9, }, - modRoof = { + { label = "Roof", parent = "bodyparts", modType = 10, }, - modHorns = { + { label = "Horns", parent = "cosmetics", modType = 14, }, - neonColor = { + { label = "Neon", parent = "cosmetics", modType = "neonColor", }, - tyreSmokeColor = { + { label = "Tiresmoke", parent = "wheels", modType = "tyreSmokeColor", }, - modSticker = { + { label = "Livery 2", parent = "cosmetics", modType = "livery2", From 59f6b673981bb21c3fb2e657370fd3e120059363 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Tue, 19 Nov 2024 07:47:47 +0530 Subject: [PATCH 14/15] Fixed lint issues. --- client/client.lua | 65 ++++++++++++++++------------------------------- 1 file changed, 22 insertions(+), 43 deletions(-) diff --git a/client/client.lua b/client/client.lua index 610b413..827aa49 100644 --- a/client/client.lua +++ b/client/client.lua @@ -8,55 +8,34 @@ local menuLocation = 'topright' -- e.g. topright (default), topleft, bottomright -- Main Menus local menu1 = MenuV:CreateMenu(false, Lang:t('menu.admin_menu'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', - 'test1') -local menu2 = MenuV:CreateMenu(false, Lang:t('menu.admin_options'), menuLocation, 220, 20, 60, 'size-125', 'none', - 'menuv', 'test2') -local menu3 = MenuV:CreateMenu(false, Lang:t('menu.manage_server'), menuLocation, 220, 20, 60, 'size-125', 'none', - 'menuv', 'test3') -local menu4 = MenuV:CreateMenu(false, Lang:t('menu.online_players'), menuLocation, 220, 20, 60, 'size-125', 'none', - 'menuv', 'test4') -local menu5 = MenuV:CreateMenu(false, Lang:t('menu.vehicle_options'), menuLocation, 220, 20, 60, 'size-125', 'none', - 'menuv', 'test5') -local menu6 = MenuV:CreateMenu(false, Lang:t('menu.dealer_list'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', - 'test6') -local menu7 = MenuV:CreateMenu(false, Lang:t('menu.developer_options'), menuLocation, 220, 20, 60, 'size-125', 'none', - 'menuv', 'test7') + 'test1') +local menu2 = MenuV:CreateMenu(false, Lang:t('menu.admin_options'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test2') +local menu3 = MenuV:CreateMenu(false, Lang:t('menu.manage_server'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test3') +local menu4 = MenuV:CreateMenu(false, Lang:t('menu.online_players'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test4') +local menu5 = MenuV:CreateMenu(false, Lang:t('menu.vehicle_options'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test5') +local menu6 = MenuV:CreateMenu(false, Lang:t('menu.dealer_list'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test6') +local menu7 = MenuV:CreateMenu(false, Lang:t('menu.developer_options'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test7') --Sub Menus -local menu8 = MenuV:CreateMenu(false, Lang:t('menu.weather_conditions'), menuLocation, 220, 20, 60, 'size-125', 'none', - 'menuv', 'test8') +local menu8 = MenuV:CreateMenu(false, Lang:t('menu.weather_conditions'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test8') local menu9 = MenuV:CreateMenu(false, Lang:t('menu.ban'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test9') -local menu10 = MenuV:CreateMenu(false, Lang:t('menu.kick'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', - 'test10') -local menu11 = MenuV:CreateMenu(false, Lang:t('menu.permissions'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', - 'test11') -local menu12 = MenuV:CreateMenu(false, Lang:t('menu.vehicle_categories'), menuLocation, 220, 20, 60, 'size-125', 'none', - 'menuv', 'test12') -local menu13 = MenuV:CreateMenu(false, Lang:t('menu.vehicle_models'), menuLocation, 220, 20, 60, 'size-125', 'none', - 'menuv', 'test13') -local menu14 = MenuV:CreateMenu(false, Lang:t('menu.entity_view_options'), menuLocation, 220, 20, 60, 'size-125', 'none', - 'menuv', 'test14') -local menu15 = MenuV:CreateMenu(false, Lang:t('menu.spawn_weapons'), menuLocation, 220, 20, 60, 'size-125', 'none', - 'menuv', 'test15') +local menu10 = MenuV:CreateMenu(false, Lang:t('menu.kick'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test10') +local menu11 = MenuV:CreateMenu(false, Lang:t('menu.permissions'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test11') +local menu12 = MenuV:CreateMenu(false, Lang:t('menu.vehicle_categories'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test12') +local menu13 = MenuV:CreateMenu(false, Lang:t('menu.vehicle_models'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test13') +local menu14 = MenuV:CreateMenu(false, Lang:t('menu.entity_view_options'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test14') +local menu15 = MenuV:CreateMenu(false, Lang:t('menu.spawn_weapons'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test15') -- Vehicle Options Menu -local vehicleoptions_menu = MenuV:CreateMenu(false, Lang:t('menu.vehicle.vehicle_options'), menuLocation, 220, 20, 60, 'size-125', - 'template1', 'menuv', 'vehiclerelatedoption') -local vehicleoptions_mod_menu = MenuV:CreateMenu(false, Lang:t('menu.vehicle.modifications'), menuLocation, 220, 20, 60, 'size-125', - 'template1', +local vehicleoptions_menu = MenuV:CreateMenu(false, Lang:t('menu.vehicle.vehicle_options'), menuLocation, 220, 20, 60, 'size-125', 'template1', 'menuv', 'vehiclerelatedoption') +local vehicleoptions_mod_menu = MenuV:CreateMenu(false, Lang:t('menu.vehicle.modifications'), menuLocation, 220, 20, 60, 'size-125', 'template1', 'menuv', 'vehmodmenu') -local color_options_mod_menu = MenuV:CreateMenu(false, Lang:t('menu.vehicle.color_menu'), menuLocation, 220, 20, 60, 'size-125', - 'template1', 'menuv', 'vehmodmenucolor') -local classic_colors_mod_menu = MenuV:CreateMenu(false, Lang:t('menu.vehicle.classic_colors'), menuLocation, 220, 20, 60, 'size-125', - 'template1', 'menuv', 'vehmodmenuclasiccol') -local tyre_smoke_color_options = MenuV:CreateMenu(false, Lang:t('menu.vehicle.tyre_smoke_colors'), menuLocation, 255, 0, 0, - 'size-125', 'template1', 'menuv', 'vehmodmenutyrsmok') -local metal_color_options = MenuV:CreateMenu(false, Lang:t('menu.vehicle.metal_colors'), menuLocation, 220, 20, 60, 'size-125', - 'template1', 'menuv', 'vehmodmenumetalcol') -local matte_color_options = MenuV:CreateMenu(false, Lang:t('menu.vehicle.matte_colors'), menuLocation, 220, 20, 60, 'size-125', - 'template1', 'menuv', 'vehmodmenumattecol') -local neon_color_options = MenuV:CreateMenu(false, Lang:t('menu.vehicle.neon_options'), menuLocation, 220, 20, 60, 'size-125', - 'template1', 'menuv', 'vehmodmenuneon') +local color_options_mod_menu = MenuV:CreateMenu(false, Lang:t('menu.vehicle.color_menu'), menuLocation, 220, 20, 60, 'size-125', 'template1', 'menuv', 'vehmodmenucolor') +local classic_colors_mod_menu = MenuV:CreateMenu(false, Lang:t('menu.vehicle.classic_colors'), menuLocation, 220, 20, 60, 'size-125', 'template1', 'menuv', 'vehmodmenuclasiccol') +local tyre_smoke_color_options = MenuV:CreateMenu(false, Lang:t('menu.vehicle.tyre_smoke_colors'), menuLocation, 255, 0, 0, 'size-125', 'template1', 'menuv', 'vehmodmenutyrsmok') +local metal_color_options = MenuV:CreateMenu(false, Lang:t('menu.vehicle.metal_colors'), menuLocation, 220, 20, 60, 'size-125', 'template1', 'menuv', 'vehmodmenumetalcol') +local matte_color_options = MenuV:CreateMenu(false, Lang:t('menu.vehicle.matte_colors'), menuLocation, 220, 20, 60, 'size-125', 'template1', 'menuv', 'vehmodmenumattecol') +local neon_color_options = MenuV:CreateMenu(false, Lang:t('menu.vehicle.neon_options'), menuLocation, 220, 20, 60, 'size-125', 'template1', 'menuv', 'vehmodmenuneon') RegisterNetEvent('qb-admin:client:openMenu', function() QBCore.Functions.TriggerCallback('qb-admin:isAdmin', function(isAdmin) From 3ac6f58c25c8d587b750cbce20597cdc0d510d74 Mon Sep 17 00:00:00 2001 From: Adharsh M Date: Tue, 19 Nov 2024 07:48:39 +0530 Subject: [PATCH 15/15] Fixed lint issues. --- client/client.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/client.lua b/client/client.lua index 827aa49..7660e65 100644 --- a/client/client.lua +++ b/client/client.lua @@ -7,8 +7,7 @@ local kickreason = 'Unknown' local menuLocation = 'topright' -- e.g. topright (default), topleft, bottomright, bottomleft -- Main Menus -local menu1 = MenuV:CreateMenu(false, Lang:t('menu.admin_menu'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', - 'test1') +local menu1 = MenuV:CreateMenu(false, Lang:t('menu.admin_menu'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test1') local menu2 = MenuV:CreateMenu(false, Lang:t('menu.admin_options'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test2') local menu3 = MenuV:CreateMenu(false, Lang:t('menu.manage_server'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test3') local menu4 = MenuV:CreateMenu(false, Lang:t('menu.online_players'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'test4')