mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 18:28:52 +00:00
Sort vehicles in chronological order, dont open shop menu if vehicle list is empty
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user