I fixed this error by overriding this
for i=1, #Categories, 1 do
vehiclesByCategory[Categories[i].name] = {}
end
for i=1, #Vehicles, 1 do
table.insert(vehiclesByCategory[Vehicles[i].category], Vehicles[i])
end
for i=1, #Categories, 1 do
local category = Categories[i]
local categoryVehicles = vehiclesByCategory[category.name]
local options = {}
for j=1, #categoryVehicles, 1 do
local vehicle = categoryVehicles[j]
if i == 1 and j == 1 then
firstVehicleData = vehicle
end
table.insert(options, vehicle.name .. ' ')
end
I put it in place instead
for i=1, #Categories, 1 do
vehiclesByCategory[Categories[i].name] = {}
end
for i=1, #Vehicles, 1 do
if IsModelInCdimage(GetHashKey(Vehicles[i].model)) then
table.insert(vehiclesByCategory[Vehicles[i].category], Vehicles[i])
else
print(('esx_vehicleshop: vehicle "%s" does not exist'):format(Vehicles[i].model))
end
end
for i=1, #Categories, 1 do
local category = Categories[i]
local categoryVehicles = vehiclesByCategory[category.name]
local options = {}
for j=1, #categoryVehicles, 1 do
local vehicle = categoryVehicles[j]
if i == 1 and j == 1 then
firstVehicleData = vehicle
end
table.insert(options, vehicle.name .. ' ')
end
Making this substitution, solved the problem
I am sorry my english skills are bad