mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 07:01:29 +00:00
Fix weaponshop
This commit is contained in:
@@ -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~',
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user