Guest User

Untitled

a guest
Jan 15th, 2021
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 25.32 KB | None | 0 0
  1. local shopData = nil
  2.  
  3. ESX = nil
  4.  
  5. Keys = {
  6.     ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
  7.     ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
  8.     ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
  9.     ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
  10.     ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
  11.     ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
  12.     ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
  13.     ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
  14.     ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
  15. }
  16.  
  17. local Licenses = {}
  18.  
  19. --[[Citizen.CreateThread(function()
  20.     while ESX == nil do
  21.         TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  22.         Citizen.Wait(0)
  23.     end
  24.  
  25.     while ESX.GetPlayerData().job == nil do
  26.         Citizen.Wait(10)
  27.     end
  28.  
  29.     ESX.PlayerData = ESX.GetPlayerData()
  30. end)--]]
  31.  
  32. Citizen.CreateThread(function()
  33.     while true do
  34.         Citizen.Wait(0)
  35.         player = GetPlayerPed(-1)
  36.         coords = GetEntityCoords(player)
  37.         if IsInRegularShopZone(coords) or IsInRobsLiquorZone(coords) or IsInYouToolZone(coords) or IsInZvejybaZone(coords) or IsInIllegalZone(coords) or IsInWeaponShopZone(coords) or IsInPoliceShop  then
  38.             if IsInPoliceShop(coords) then
  39.                 --if IsControlJustReleased(0, Keys["E"]) and ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' then
  40.                 if IsControlJustReleased(0, Keys["E"]) then
  41.                     --if ESX.PlayerData.job.name == "police" then
  42.                         OpenJobShopInv("policeshop")
  43.                         Citizen.Wait(2000)
  44.                    -- end
  45.                 end
  46.             end
  47.             if IsInRegularShopZone(coords) then
  48.                 if IsControlJustReleased(0, Keys["E"]) then
  49.                     OpenShopInv("regular")
  50.                     Citizen.Wait(2000)
  51.                 end
  52.             end
  53.             if IsInRobsLiquorZone(coords) then
  54.                 if IsControlJustReleased(0, Keys["E"]) then
  55.                     OpenShopInv("robsliquor")
  56.                     Citizen.Wait(2000)
  57.                 end
  58.             end
  59.             if IsInYouToolZone(coords) then
  60.                 if IsControlJustReleased(0, Keys["E"]) then
  61.                     OpenShopInv("youtool")
  62.                     Citizen.Wait(2000)
  63.                 end
  64.             end
  65.             if IsInZvejybaZone(coords) then
  66.                 if IsControlJustReleased(0, Keys["E"]) then
  67.                     OpenShopInv("zvejyba")
  68.                     Citizen.Wait(2000)
  69.                 end
  70.             end
  71.             if IsInIllegalZone(coords) then
  72.                 if IsControlJustReleased(0, Keys["E"]) then
  73.                     OpenShopInv("illegal")
  74.                     Citizen.Wait(2000)
  75.                 end
  76.             end
  77.             if IsInWeaponShopZone(coords) then
  78.                 if currentAction then
  79.                     ESX.ShowHelpNotification(currentActionMsg)
  80.                     if IsControlJustReleased(0, Keys["E"]) then
  81.                         ESX.TriggerServerCallback('esx_license:checkLicense', function(hasWeaponLicense)
  82.                             if hasWeaponLicense then
  83.                                 OpenShopInv("weaponshop")
  84.                                 Citizen.Wait(2000)
  85.                             else
  86.                             exports['mythic_notify']:DoHudText('error', _U('license_check_fail'))
  87.                             end
  88.                         end, GetPlayerServerId(PlayerId()), 'weapon')
  89.                     end
  90.                 end
  91.             end
  92.         end
  93.     end
  94. end)
  95.  
  96. function OpenJobShopInv(shoptype)
  97.     text = "Parduotuvė"
  98.     data = {text = text}
  99.     inventory = {}
  100.  
  101.     ESX.TriggerServerCallback("suku:getJobShopItems", function(shopInv)
  102.         for i=1, #shopInv, 1 do
  103.             table.insert(inventory, shopInv[i])
  104.         end
  105.     end, shoptype)
  106.  
  107.     Citizen.Wait(500)
  108.     TriggerEvent("esx_inventoryhud:openShopInventory", data, inventory)
  109. end
  110.  
  111. function OpenShopInv(shoptype)
  112.     text = "Parduotuvė"
  113.     data = {text = text}
  114.     inventory = {}
  115.  
  116.     ESX.TriggerServerCallback("suku:getShopItems", function(shopInv)
  117.         for i = 1, #shopInv, 1 do
  118.             table.insert(inventory, shopInv[i])
  119.         end
  120.     end, shoptype)
  121.  
  122.     Citizen.Wait(500)
  123.     TriggerEvent("esx_inventoryhud:openShopInventory", data, inventory)
  124. end
  125.  
  126. RegisterNetEvent("suku:OpenCustomShopInventory")
  127. AddEventHandler("suku:OpenCustomShopInventory", function(type, shopinventory)
  128.     text = "Parduotuvė"
  129.     data = {text = text}
  130.     inventory = {}
  131.  
  132.     ESX.TriggerServerCallback("suku:getCustomShopItems", function(shopInv)
  133.         for i = 1, #shopInv, 1 do
  134.             table.insert(inventory, shopInv[i])
  135.         end
  136.     end, type, shopinventory)
  137.     Citizen.Wait(500)
  138.  
  139.     TriggerEvent("esx_inventoryhud:openShopInventory", data, inventory)
  140. end)
  141.  
  142. RegisterNetEvent("esx_inventoryhud:openShopInventory")
  143. AddEventHandler("esx_inventoryhud:openShopInventory", function(data, inventory)
  144.         setShopInventoryData(data, inventory, weapons)
  145.         openShopInventory()
  146. end)
  147.  
  148. function setShopInventoryData(data, inventory)
  149.     shopData = data
  150.  
  151.     SendNUIMessage(
  152.         {
  153.             action = "setInfoText",
  154.             text = data.text
  155.         }
  156.     )
  157.  
  158.     items = {}
  159.  
  160.     SendNUIMessage(
  161.         {
  162.             action = "setShopInventoryItems",
  163.             itemList = inventory
  164.         }
  165.     )
  166. end
  167.  
  168. function openShopInventory()
  169.     loadPlayerInventory()
  170.     isInInventory = true
  171.  
  172.     SendNUIMessage(
  173.         {
  174.             action = "display",
  175.             type = "shop"
  176.         }
  177.     )
  178.  
  179.     SetNuiFocus(true, true)
  180. end
  181.  
  182. RegisterNUICallback("TakeFromShop", function(data, cb)
  183.         if IsPedSittingInAnyVehicle(playerPed) then
  184.             return
  185.         end
  186.  
  187.         if type(data.number) == "number" and math.floor(data.number) == data.number then
  188.             TriggerServerEvent("suku:SellItemToPlayer", GetPlayerServerId(PlayerId()), data.item.type, data.item.name, tonumber(data.number))
  189.         end
  190.  
  191.         Wait(150)
  192.         loadPlayerInventory()
  193.  
  194.         cb("ok")
  195.     end
  196. )
  197.  
  198. RegisterNetEvent("suku:AddAmmoToWeapon")
  199. AddEventHandler("suku:AddAmmoToWeapon", function(hash, amount)
  200.     AddAmmoToPed(GetPlayerPed(-1), hash, amount)
  201. end)
  202.  
  203. function IsInPoliceShop(coords)
  204.     PoliceShop = Config.JobShops.PoliceShop.Locations
  205.     for i = 1, #PoliceShop, 1 do
  206.         if GetDistanceBetweenCoords(coords, PoliceShop[i].x, PoliceShop[i].y, PoliceShop[i].z, true) < 1.5 then
  207.             SetTextComponentFormat("STRING")
  208.             AddTextComponentString("Spauskite ~INPUT_VEH_HORN~, kad atidarytumete parduotuve")
  209.             DisplayHelpTextFromStringLabel(0, 0, 0, -1)
  210.             return true
  211.         end
  212.     end
  213.     return false
  214. end
  215.  
  216. function IsInRegularShopZone(coords)
  217.     RegularShop = Config.Shops.RegularShop.Locations
  218.     for i = 1, #RegularShop, 1 do
  219.         if GetDistanceBetweenCoords(coords, RegularShop[i].x, RegularShop[i].y, RegularShop[i].z, true) < 1.5 then
  220.                 SetTextComponentFormat("STRING")
  221.                 AddTextComponentString("Spauskite ~INPUT_VEH_HORN~, kad atidarytumete ~g~parduotuves~s~ meniu.")
  222.                 DisplayHelpTextFromStringLabel(0, 0, 0, -1)
  223.             return true
  224.         end
  225.     end
  226.     return false
  227. end
  228.  
  229. function IsInRobsLiquorZone(coords)
  230.     RobsLiquor = Config.Shops.RobsLiquor.Locations
  231.     for i = 1, #RobsLiquor, 1 do
  232.         if GetDistanceBetweenCoords(coords, RobsLiquor[i].x, RobsLiquor[i].y, RobsLiquor[i].z, true) < 1.5 then
  233.                 SetTextComponentFormat("STRING")
  234.                 AddTextComponentString("Spauskite ~INPUT_VEH_HORN~, kad atidarytumete ~p~alkoholio parduotuves~s~ meniu.")
  235.                 DisplayHelpTextFromStringLabel(0, 0, 0, -1)
  236.             return true
  237.         end
  238.     end
  239.     return false
  240. end
  241.  
  242. function IsInWeaponShopZone(coords)
  243.     WeaponShop = Config.Shops.WeaponShop.Locations
  244.     for i = 1, #WeaponShop, 1 do
  245.         if GetDistanceBetweenCoords(coords, WeaponShop[i].x, WeaponShop[i].y, WeaponShop[i].z, true) < 1.5 then
  246.             SetTextComponentFormat("STRING")
  247.             AddTextComponentString("Spauskite ~INPUT_VEH_HORN~, kad atidarytumete ~p~alkoholio parduotuves~s~ meniu.")
  248.             DisplayHelpTextFromStringLabel(0, 0, 0, -1)
  249.             return true
  250.         end
  251.     end
  252.     return false
  253. end
  254.  
  255.  
  256. Citizen.CreateThread(function()
  257.     while true do
  258.         Citizen.Wait(0)
  259.         LicenseShop = Config.Shops.LicenseShop.Locations
  260.         player = GetPlayerPed(-1)
  261.         coords = GetEntityCoords(player)
  262.         for i = 1, #LicenseShop, 1 do
  263.             if GetDistanceBetweenCoords(coords, LicenseShop[i].x, LicenseShop[i].y, LicenseShop[i].z, true) < 8.0 then
  264.                 DrawMarker(25, LicenseShop[i].x, LicenseShop[i].y, LicenseShop[i].z - 0.99, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, nil, nil, false)
  265.                     if currentAction then
  266.                         ESX.ShowHelpNotification(_U('license_shop_help'))
  267.                         if IsControlJustReleased(0, 38) then
  268.                             ESX.TriggerServerCallback('esx_license:checkLicense', function(hasWeaponLicense)
  269.                             if hasWeaponLicense then
  270.                                 exports['mythic_notify']:DoHudText('error', _U('license_shop_check'))
  271.                             else
  272.                                 OpenBuyLicenseMenu()
  273.                                 Citizen.Wait(2000)
  274.                             end
  275.                         end, GetPlayerServerId(PlayerId()), Config.License.Weapon)
  276.                     end
  277.                 end
  278.             end
  279.         end
  280.     end
  281. end)
  282.  
  283. Citizen.CreateThread(function()
  284.     while true do
  285.         Player = nil
  286.         Citizen.Wait(0)
  287.         local playerCoords = GetEntityCoords(PlayerPedId())
  288.         local isInMarker, letSleep, currentZone = false, false
  289.         for k,v in pairs(Config.Shops) do
  290.             for i = 1, #v.Locations, 1 do
  291.                 local distance = GetDistanceBetweenCoords(playerCoords, v.Locations[i].x, v.Locations[i].y, v.Locations[i].z, true)
  292.                 if distance <  1.5 then
  293.                     letSleep = false
  294.                     if distance < Config.MarkerSize.x then
  295.                         isInMarker  = true
  296.                         currentZone = k
  297.                         lastZone    = k
  298.                     end
  299.                 end
  300.             end
  301.         end
  302.         if isInMarker and not hasAlreadyEnteredMarker then
  303.             hasAlreadyEnteredMarker = true
  304.             TriggerEvent('suku:hasEnteredMarker', currentZone)
  305.         end
  306.         if not isInMarker and hasAlreadyEnteredMarker then
  307.             hasAlreadyEnteredMarker = false
  308.             TriggerEvent('suku:hasExitedMarker', lastZone)
  309.         end
  310.         if letSleep then
  311.             Citizen.Wait(500)
  312.         end
  313.     end
  314. end)
  315.  
  316. AddEventHandler('suku:hasEnteredMarker', function(zone)
  317.     currentAction     = 'shop_menu'
  318.     currentActionMsg  = _U('shop_press_menu')
  319.     currentActionData = {zone = zone}
  320. end)
  321.  
  322. function OpenBuyLicenseMenu()
  323.     ESX.UI.Menu.CloseAll()
  324.     ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop_license',{
  325.     title = _U('license_shop_title'),
  326.         elements = {
  327.             { label = _U('yes') ..' (€' .. Config.LicensePrice ..')', value = 'yes' },
  328.             { label = _U('no'), value = 'no' },
  329.         }
  330.     },
  331.       function (data, menu)    
  332.         if data.current.value == 'yes' then
  333.             ESX.TriggerServerCallback('suku:buyLicense', function(bought)
  334.                 if bought then
  335.                     menu.close()
  336.                 end
  337.             end)
  338.         end
  339.     end,
  340.     function (data, menu)
  341.         menu.close()
  342.     end)
  343. end
  344.  
  345. function IsInYouToolZone(coords)
  346.     YouTool = Config.Shops.YouTool.Locations
  347.     for i = 1, #YouTool, 1 do
  348.         if GetDistanceBetweenCoords(coords, YouTool[i].x, YouTool[i].y, YouTool[i].z, true) < 1.5 then
  349.                 SetTextComponentFormat("STRING")
  350.                 AddTextComponentString("Spauskite ~INPUT_VEH_HORN~, kad atidarytumete ~b~irankiu parduotuves~s~ meniu.")
  351.                 DisplayHelpTextFromStringLabel(0, 0, 0, -1)
  352.             return true
  353.         end
  354.     end
  355.     return false
  356. end
  357.  
  358. function IsInZvejybaZone(coords)
  359.     Zvejyba = Config.Shops.Zvejyba.Locations
  360.     for i = 1, #Zvejyba, 1 do
  361.         if GetDistanceBetweenCoords(coords, Zvejyba[i].x, Zvejyba[i].y, Zvejyba[i].z, true) < 1.5 then
  362.                 SetTextComponentFormat("STRING")
  363.                 AddTextComponentString("Spauskite ~INPUT_VEH_HORN~, kad atidarytumete ~b~zvejybos parduotuves~s~ meniu.")
  364.                 DisplayHelpTextFromStringLabel(0, 0, 0, -1)
  365.             return true
  366.         end
  367.     end
  368.     return false
  369. end
  370.  
  371. function IsInIllegalZone(coords)
  372.     Illegal = Config.Shops.Illegal.Locations
  373.     for i = 1, #Illegal, 1 do
  374.         if GetDistanceBetweenCoords(coords, Illegal[i].x, Illegal[i].y, Illegal[i].z, true) < 1.5 then
  375.                 SetTextComponentFormat("STRING")
  376.                 AddTextComponentString("Spauskite ~INPUT_VEH_HORN~, kad atidarytumete ~b~irankiu parduotuves~s~ meniu.")
  377.                 DisplayHelpTextFromStringLabel(0, 0, 0, -1)
  378.             return true
  379.         end
  380.     end
  381.     return false
  382. end
  383.  
  384.  
  385. RegisterNetEvent('suku:GetLicenses')
  386. AddEventHandler('suku:GetLicenses', function (licenses)
  387.     for i = 1, #licenses, 1 do
  388.         Licenses[licenses[i].type] = true
  389.     end
  390. end)
  391.  
  392. Citizen.CreateThread(function()
  393.     player = GetPlayerPed(-1)
  394.     coords = GetEntityCoords(player)
  395.     for k, v in pairs(Config.Shops.RegularShop.Locations) do
  396.         CreateBlip(vector3(Config.Shops.RegularShop.Locations[k].x, Config.Shops.RegularShop.Locations[k].y, Config.Shops.RegularShop.Locations[k].z ), "Parduotuve", 3.0, Config.ColorShop, Config.ShopBlipID, 0.8)
  397.     end
  398.  
  399.     for k, v in pairs(Config.Shops.RobsLiquor.Locations) do
  400.         CreateBlip(vector3(Config.Shops.RobsLiquor.Locations[k].x, Config.Shops.RobsLiquor.Locations[k].y, Config.Shops.RobsLiquor.Locations[k].z ), "Alkoholio Parduotuve", 3.0, Config.ColorLiqour, Config.LiquorBlipID, 0.8)
  401.     end
  402.  
  403.     for k, v in pairs(Config.Shops.WeaponShop.Locations) do
  404.         CreateBlip(vector3(Config.Shops.WeaponShop.Locations[k].x, Config.Shops.WeaponShop.Locations[k].y, Config.Shops.WeaponShop.Locations[k].z ), "Ginklu Parduotuve", 3.0, Config.ColorWeaponShop, Config.WeaponShopBlipID, 0.5)
  405.     end
  406.  
  407.     for k, v in pairs(Config.Shops.LicenseShop.Locations) do
  408.         CreateBlip(vector3(Config.Shops.LicenseShop.Locations[k].x, Config.Shops.LicenseShop.Locations[k].y, Config.Shops.LicenseShop.Locations[k].z ), "Ginklu Parduotuve", 3.0, Config.ColorLicenseShop, Config.LicenseShopBlipID, 0.5)
  409.     end
  410.  
  411.     for k, v in pairs(Config.Shops.Zvejyba.Locations) do
  412.         CreateBlip(vector3(Config.Shops.Zvejyba.Locations[k].x, Config.Shops.Zvejyba.Locations[k].y, Config.Shops.Zvejyba.Locations[k].z ), "Zvejybos Parduotuve", 3.0, Config.ColorZvejyba, Config.ZvejybaBlipID, 0.5)
  413.     end
  414.  
  415.     for k, v in pairs(Config.Shops.YouTool.Locations) do
  416.         CreateBlip(vector3(Config.Shops.YouTool.Locations[k].x, Config.Shops.YouTool.Locations[k].y, Config.Shops.YouTool.Locations[k].z ), "Irankiu Parduotuve", 3.0, Config.ColorYouTool, Config.YouToolBlipID, 0.5)
  417.     end
  418. end)
  419.  
  420.  
  421. AddEventHandler('suku:hasEnteredMarker', function(zone)
  422.     currentAction     = 'shop_menu'
  423.     currentActionMsg  = _U('shop_press_menu')
  424.     currentActionData = {zone = zone}
  425. end)
  426.  
  427. AddEventHandler('suku:hasExitedMarker', function(zone)
  428.     SendNUIMessage({
  429.         display = false,
  430.         clear = true
  431.     })
  432.     currentAction = false
  433.     SetNuiFocus(false, false)
  434. end)
  435.  
  436. Citizen.CreateThread(function()
  437.     while true do
  438.         Citizen.Wait(0)
  439.         player = GetPlayerPed(-1)
  440.         coords = GetEntityCoords(player)
  441.  
  442.         for k, v in pairs(Config.Shops.RegularShop.Locations) do
  443.             if GetDistanceBetweenCoords(coords, Config.Shops.RegularShop.Locations[k].x, Config.Shops.RegularShop.Locations[k].y, Config.Shops.RegularShop.Locations[k].z, true) < 15.0 then
  444.                 ESX.Game.Utils.DrawText3D(vector3(Config.Shops.RegularShop.Locations[k].x, Config.Shops.RegularShop.Locations[k].y, Config.Shops.RegularShop.Locations[k].z + 1.0), "Spausk ~r~[E]~s~ kad patektum i parduotuves meniu", 0.6, 4)
  445.                 DrawMarker(29, Config.Shops.RegularShop.Locations[k].x, Config.Shops.RegularShop.Locations[k].y, Config.Shops.RegularShop.Locations[k].z+1, 0, 0, 0, 0, 0, 0, 0.3, 0.1, 0.3, 82, 255, 84, 150, 0, 0, 0, true)
  446.                 DrawMarker(20, Config.Shops.RegularShop.Locations[k].x, Config.Shops.RegularShop.Locations[k].y, Config.Shops.RegularShop.Locations[k].z+1.15, 0, 0, 0, 0, 0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  447.                 DrawMarker(20,Config.Shops.RegularShop.Locations[k].x, Config.Shops.RegularShop.Locations[k].y, Config.Shops.RegularShop.Locations[k].z+0.85, 0, 0, 0, 0, 180.0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  448.                
  449.             end
  450.         end
  451.  
  452.         for k, v in pairs(Config.Shops.RobsLiquor.Locations) do
  453.             if GetDistanceBetweenCoords(coords, Config.Shops.RobsLiquor.Locations[k].x, Config.Shops.RobsLiquor.Locations[k].y, Config.Shops.RobsLiquor.Locations[k].z, true) < 15.0 then
  454.                 DrawMarker(29, Config.Shops.RobsLiquor.Locations[k].x, Config.Shops.RobsLiquor.Locations[k].y, Config.Shops.RobsLiquor.Locations[k].z+1, 0, 0, 0, 0, 0, 0, 0.3, 0.1, 0.3, 241, 150, 255, 150, 0, 0, 0, true)
  455.                 DrawMarker(20, Config.Shops.RobsLiquor.Locations[k].x, Config.Shops.RobsLiquor.Locations[k].y, Config.Shops.RobsLiquor.Locations[k].z+1.15, 0, 0, 0, 0, 0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  456.                 DrawMarker(20, Config.Shops.RobsLiquor.Locations[k].x, Config.Shops.RobsLiquor.Locations[k].y, Config.Shops.RobsLiquor.Locations[k].z+0.85, 0, 0, 0, 0, 180.0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  457.                 ESX.Game.Utils.DrawText3D(vector3(Config.Shops.RobsLiquor.Locations[k].x, Config.Shops.RobsLiquor.Locations[k].y, Config.Shops.RobsLiquor.Locations[k].z + 1.0), "Spausk ~r~[E]~s~ kad patektum i parduotuves meniu", 0.6, 4)
  458.                
  459.             end
  460.         end
  461.  
  462.         for k, v in pairs(Config.Shops.WeaponShop.Locations) do
  463.             if GetDistanceBetweenCoords(coords, Config.Shops.WeaponShop.Locations[k].x, Config.Shops.WeaponShop.Locations[k].y, Config.Shops.WeaponShop.Locations[k].z, true) < 15.0 then
  464.                 DrawMarker(29, Config.Shops.WeaponShop.Locations[k].x, Config.Shops.WeaponShop.Locations[k].y, Config.Shops.WeaponShop.Locations[k].z+1, 0, 0, 0, 0, 0, 0, 0.3, 0.1, 0.3, 241, 150, 255, 150, 0, 0, 0, true)
  465.                 DrawMarker(20, Config.Shops.WeaponShop.Locations[k].x, Config.Shops.WeaponShop.Locations[k].y, Config.Shops.WeaponShop.Locations[k].z+1.15, 0, 0, 0, 0, 0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  466.                 DrawMarker(20, Config.Shops.WeaponShop.Locations[k].x, Config.Shops.WeaponShop.Locations[k].y, Config.Shops.WeaponShop.Locations[k].z+0.85, 0, 0, 0, 0, 180.0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  467.                 ESX.Game.Utils.DrawText3D(vector3(Config.Shops.WeaponShop.Locations[k].x, Config.Shops.WeaponShop.Locations[k].y, Config.Shops.WeaponShop.Locations[k].z + 1.0), "Spausk ~r~[E]~s~ kad patektum i ginklu meniu", 0.6, 4)
  468.                
  469.             end
  470.         end
  471.  
  472.         for k, v in pairs(Config.Shops.Illegal.Locations) do
  473.             if GetDistanceBetweenCoords(coords, Config.Shops.Illegal.Locations[k].x, Config.Shops.Illegal.Locations[k].y, Config.Shops.Illegal.Locations[k].z, true) < 15.0 then
  474.                 ESX.Game.Utils.DrawText3D(vector3(Config.Shops.Illegal.Locations[k].x, Config.Shops.Illegal.Locations[k].y, Config.Shops.Illegal.Locations[k].z + 1.0), "Spausk ~r~[E]~s~ kad patektum i parduotuves meniu", 0.6, 4)
  475.                 DrawMarker(29, Config.Shops.Illegal.Locations[k].x, Config.Shops.Illegal.Locations[k].y, Config.Shops.Illegal.Locations[k].z+1, 0, 0, 0, 0, 0, 0, 0.3, 0.1, 0.3, 82, 192, 255, 150, 0, 0, 0, true)
  476.                 DrawMarker(20, Config.Shops.Illegal.Locations[k].x, Config.Shops.Illegal.Locations[k].y, Config.Shops.Illegal.Locations[k].z+1.15, 0, 0, 0, 0, 0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  477.                 DrawMarker(20, Config.Shops.Illegal.Locations[k].x, Config.Shops.Illegal.Locations[k].y, Config.Shops.Illegal.Locations[k].z+0.85, 0, 0, 0, 0, 180.0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  478.             end
  479.         end
  480.  
  481.         for k, v in pairs(Config.Shops.Zvejyba.Locations) do
  482.             if GetDistanceBetweenCoords(coords, Config.Shops.Zvejyba.Locations[k].x, Config.Shops.Zvejyba.Locations[k].y, Config.Shops.Zvejyba.Locations[k].z, true) < 15.0 then
  483.                 ESX.Game.Utils.DrawText3D(vector3(Config.Shops.Zvejyba.Locations[k].x, Config.Shops.Zvejyba.Locations[k].y, Config.Shops.Zvejyba.Locations[k].z + 1.0), "Spausk ~r~[E]~s~ kad patektum i parduotuves meniu", 0.6, 4)
  484.                 DrawMarker(29, Config.Shops.Zvejyba.Locations[k].x, Config.Shops.Zvejyba.Locations[k].y, Config.Shops.Zvejyba.Locations[k].z+1, 0, 0, 0, 0, 0, 0, 0.3, 0.1, 0.3, 82, 192, 255, 150, 0, 0, 0, true)
  485.                 DrawMarker(20, Config.Shops.Zvejyba.Locations[k].x, Config.Shops.Zvejyba.Locations[k].y, Config.Shops.Zvejyba.Locations[k].z+1.15, 0, 0, 0, 0, 0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  486.                 DrawMarker(20, Config.Shops.Zvejyba.Locations[k].x, Config.Shops.Zvejyba.Locations[k].y, Config.Shops.Zvejyba.Locations[k].z+0.85, 0, 0, 0, 0, 180.0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  487.             end
  488.         end
  489.  
  490.         for k, v in pairs(Config.Shops.YouTool.Locations) do
  491.             if GetDistanceBetweenCoords(coords, Config.Shops.YouTool.Locations[k].x, Config.Shops.YouTool.Locations[k].y, Config.Shops.YouTool.Locations[k].z, true) < 15.0 then
  492.                 ESX.Game.Utils.DrawText3D(vector3(Config.Shops.YouTool.Locations[k].x, Config.Shops.YouTool.Locations[k].y, Config.Shops.YouTool.Locations[k].z + 1.0), "Spausk ~r~[E]~s~ kad patektum i parduotuves meniu", 0.6, 4)
  493.                 DrawMarker(29, Config.Shops.YouTool.Locations[k].x, Config.Shops.YouTool.Locations[k].y, Config.Shops.YouTool.Locations[k].z+1, 0, 0, 0, 0, 0, 0, 0.3, 0.1, 0.3, 82, 192, 255, 150, 0, 0, 0, true)
  494.                 DrawMarker(20, Config.Shops.YouTool.Locations[k].x, Config.Shops.YouTool.Locations[k].y, Config.Shops.YouTool.Locations[k].z+1.15, 0, 0, 0, 0, 0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  495.                 DrawMarker(20, Config.Shops.YouTool.Locations[k].x, Config.Shops.YouTool.Locations[k].y, Config.Shops.YouTool.Locations[k].z+0.85, 0, 0, 0, 0, 180.0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  496.             end
  497.         end
  498.  
  499.         for k, v in pairs(Config.JobShops.PoliceJob.Locations) do
  500.             --[[if GetDistanceBetweenCoords(coords,Config.JobShops.PoliceJob.Locations[k].x, Config.JobShops.PoliceJob.Locations[k].y, Config.JobShops.PoliceJob.Locations[k].z, true) < 15.0 then
  501.                 ESX.Game.Utils.DrawText3D(vector3(Config.JobShops.PoliceJob.Locations[k].x, Config.JobShops.PoliceJob.Locations[k].y, Config.JobShops.PoliceJob.Locations[k].z + 1.0), "Spauskite ~r~[E]~s~, kad atidarytumėte ginklų parduotuvę", 0.6, 4)
  502.                 DrawMarker(29, Config.JobShops.PoliceJob.Locations[k].x, Config.JobShops.PoliceJob.Locations[k].y, Config.JobShops.PoliceJob.Locations[k].z+1, 0, 0, 0, 0, 0, 0, 0.3, 0.1, 0.3, 82, 192, 255, 150, 0, 0, 0, true)
  503.                 DrawMarker(20, Config.JobShops.PoliceJob.Locations[k].x, Config.JobShops.PoliceJob.Locations[k].y, Config.JobShops.PoliceJob.Locations[k].z+1.15, 0, 0, 0, 0, 0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  504.                 DrawMarker(20, Config.JobShops.PoliceJob.Locations[k].x, Config.JobShops.PoliceJob.Locations[k].y, Config.JobShops.PoliceJob.Locations[k].z+0.85, 0, 0, 0, 0, 180.0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  505.             end--]]
  506.             if GetDistanceBetweenCoords(coords, Config.JobShops.PoliceJob.Locations[k].x, Config.JobShops.PoliceJob.Locations[k].y, Config.JobShops.PoliceJob.Locations[k].z, true) < 15.0 then
  507.                 DrawMarker(29, Config.JobShops.PoliceJob.Locations[k].x, Config.JobShops.PoliceJob.Locations[k].y, Config.JobShops.PoliceJob.Locations[k].z+1, 0, 0, 0, 0, 0, 0, 0.3, 0.1, 0.3, 241, 150, 255, 150, 0, 0, 0, true)
  508.                 DrawMarker(20, Config.JobShops.PoliceJob.Locations[k].x, Config.JobShops.PoliceJob.Locations[k].y, Config.JobShops.PoliceJob.Locations[k].z+1.15, 0, 0, 0, 0, 0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  509.                 DrawMarker(20, Config.JobShops.PoliceJob.Locations[k].x, Config.JobShops.PoliceJob.Locations[k].y, Config.JobShops.PoliceJob.Locations[k].z+0.85, 0, 0, 0, 0, 180.0, 0, 0.1, 0.1, 0.1, 255, 227, 48, 150, 0, 0, 0, true)
  510.                 ESX.Game.Utils.DrawText3D(vector3(Config.JobShops.PoliceJobLocations[k].x, Config.JobShops.PoliceJob.Locations[k].y, Config.JobShops.PoliceJob.Locations[k].z + 1.0), "Spauskite ~r~[E]~s~, kad atidarytumėte ginklų parduotuvę", 0.6, 4)
  511.                
  512.             end
  513.         end
  514.     end
  515. end)
  516.  
  517. function CreateBlip(coords, text, radius, color, sprite)
  518.     local blip = AddBlipForCoord(coords)
  519.     SetBlipSprite(blip, sprite)
  520.     SetBlipColour(blip, color)
  521.     SetBlipScale(blip, 0.6)
  522.     SetBlipAsShortRange(blip, true)
  523.     BeginTextCommandSetBlipName("STRING")
  524.     AddTextComponentString(text)
  525.     EndTextCommandSetBlipName(blip)
  526. end
Advertisement
Add Comment
Please, Sign In to add comment