Sort vehicles in chronological order, dont open shop menu if vehicle list is empty

This commit is contained in:
ElPumpo
2020-02-08 12:54:45 +01:00
parent 14fbc69357
commit b623f11a73
+7
View File
@@ -139,6 +139,11 @@ function StartShopRestriction()
end
function OpenShopMenu()
if #Vehicles == 0 then
print('[esx_vehicleshop] [^3ERROR^7] No vehicles found')
return
end
IsInShopMenu = true
StartShopRestriction()
@@ -181,6 +186,8 @@ function OpenShopMenu()
table.insert(options, ('%s <span style="color:green;">%s</span>'):format(vehicle.name, _U('generic_shopitem', ESX.Math.GroupDigits(vehicle.price))))
end
table.sort(options)
table.insert(elements, {
name = category.name,
label = category.label,