Skip to content

Commit

Permalink
Merge pull request #488 from ThatMadCap/main
Browse files Browse the repository at this point in the history
fix(client\vehicletext): brand name text duplicate
  • Loading branch information
GhzGarage authored Jan 6, 2025
2 parents eb5da14 + 4fc973e commit dd53a5c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/vehicletext.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ local QBCore = exports['qb-core']:GetCoreObject()
CreateThread(function()
for _, v in pairs(QBCore.Shared.Vehicles) do
local text
if v.brand then
text = v.brand..' '..v.name
local name = string.lower(v.name)
local brand = string.lower(v.brand)
if v.brand and string.match(name, brand) then
local nameWithoutBrand = string.gsub(name, brand, "")
text = v.brand .. ' ' .. nameWithoutBrand
else
text = v.name
end
Expand Down

0 comments on commit dd53a5c

Please sign in to comment.