From b623f11a73b080f6480821a715b1ec2a84f3e179 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 8 Feb 2020 12:54:45 +0100 Subject: [PATCH] Sort vehicles in chronological order, dont open shop menu if vehicle list is empty --- client/main.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/main.lua b/client/main.lua index e6de7966..4814b249 100644 --- a/client/main.lua +++ b/client/main.lua @@ -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 %s'):format(vehicle.name, _U('generic_shopitem', ESX.Math.GroupDigits(vehicle.price)))) end + table.sort(options) + table.insert(elements, { name = category.name, label = category.label,