From 0807663f645b0ed1ae9972dd7cbd7c50908c2948 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Tue, 24 May 2022 21:39:57 +0100 Subject: [PATCH] Fix weaponshop --- [esx_addons]/esx_vehicleshop/locales/en.lua | 6 +++--- [esx_addons]/esx_weaponshop/client/main.lua | 21 +++++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/[esx_addons]/esx_vehicleshop/locales/en.lua b/[esx_addons]/esx_vehicleshop/locales/en.lua index a596a8be..3f74b3ca 100644 --- a/[esx_addons]/esx_vehicleshop/locales/en.lua +++ b/[esx_addons]/esx_vehicleshop/locales/en.lua @@ -30,13 +30,13 @@ Locales['en'] = { ['rent_vehicle'] = 'car Dealer - Vehicles for rent', ['return_provider_menu'] = 'car Dealer - Return vehicle to provider', ['rental_amount'] = 'rental amount', - ['sell_menu'] = 'press ~INPUT_CONTEXT~ to sell your ~y~%s~s~ for ~g~$%s~s~', + ['sell_menu'] = 'press [E] to sell your ~y~%s~s~ for ~g~$%s~s~', ['set_vehicle_owner_rent'] = 'rent vehicle', ['set_vehicle_owner_sell'] = 'sell vehicle', - ['shop_menu'] = 'press ~INPUT_CONTEXT~ to access the menu', + ['shop_menu'] = 'press [E] to access the menu', ['generic_shopitem'] = '$%s', ['vehicle_dealer'] = 'vehicle - Car Dealer', - ['vehicle_menu'] = 'press ~INPUT_CONTEXT~ to give back the rented vehicle', + ['vehicle_menu'] = 'press [E] to give back the rented vehicle', ['vehicle_purchased'] = 'you bought a vehicle', ['vehicle_set_owned'] = 'vehicle ~y~%s~s~ has been assigned to ~b~%s~s~', ['vehicle_set_rented'] = 'vehicle ~y~%s~s~ has been rented to ~b~%s~s~', diff --git a/[esx_addons]/esx_weaponshop/client/main.lua b/[esx_addons]/esx_weaponshop/client/main.lua index 2b0b2930..0132972e 100644 --- a/[esx_addons]/esx_weaponshop/client/main.lua +++ b/[esx_addons]/esx_weaponshop/client/main.lua @@ -130,15 +130,19 @@ end) CreateThread(function() while true do local Sleep = 1500 - + local InShop = false local coords = GetEntityCoords(PlayerPedId()) for k,v in pairs(Config.Zones) do for i = 1, #v.Locations, 1 do if (Config.Type ~= -1 and #(coords - v.Locations[i]) < Config.DrawDistance) then + InShop = true Sleep = 0 - ESX.ShowHelpNotification(_U('shop_menu_prompt')) - + if not ShopOpen then + ESX.TextUI(_U('shop_menu_prompt')) + else + ESX.HideUI() + end if IsControlJustReleased(0, 38) then if Config.LicenseEnable and v.Legal then ESX.TriggerServerCallback('esx_license:checkLicense', function(hasWeaponLicense) @@ -153,14 +157,15 @@ CreateThread(function() end end DrawMarker(Config.Type, v.Locations[i], 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.Size.x, Config.Size.y, Config.Size.z, Config.Color.r, Config.Color.g, Config.Color.b, 100, false, true, 2, false, false, false, false) - else - if ShopOpen then - ESX.UI.Menu.CloseAll() - ShopOpen = false - end end end end + if not InShop and ShopOpen then + if ShopOpen then + ESX.UI.Menu.CloseAll() + ShopOpen = false + end + end Wait(Sleep) end end)