Advertisement
Guest User

CLIENT UTILS

a guest
Aug 7th, 2022
814
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.41 KB | None | 0 0
  1. lib.locale()
  2.  
  3. if Config.Framework == "ESX" then
  4.     ESX = nil
  5.     CreateThread(function()
  6.         while ESX == nil do
  7.             TriggerEvent("esx:getSharedObject", function(obj) ESX = obj end)
  8.             Wait(100)
  9.         end
  10.     end)
  11. elseif Config.Framework == "qbcore" then
  12.     QBCore = nil
  13.     QBCore = exports["qb-core"]:GetCoreObject()
  14. elseif Config.Framework == "standalone" then
  15.     -- ADD YOU FRAMEWORK
  16. end
  17.  
  18. -- Your notification type settings
  19. -- •» You can edit a type of notifications, with chaning type or triggering your own.
  20. Notify = function(type, title, text)
  21.     if Config.NotificationType == "ESX" then
  22.         ESX.ShowNotification(text)
  23.     elseif Config.NotificationType == "ox_lib" then
  24.         if type == "info" then
  25.             lib.notify({
  26.                 title = title,
  27.                 description = text,
  28.                 type = "inform"
  29.             })
  30.         elseif type == "error" then
  31.             lib.notify({
  32.                 title = title,
  33.                 description = text,
  34.                 type = "error"
  35.             })
  36.         elseif type == "success" then
  37.             lib.notify({
  38.                 title = title,
  39.                 description = text,
  40.                 type = "success"
  41.             })
  42.         elseif Config.NotificationType == "qbcore" then
  43.             if type == "success" then
  44.                 QBCore.Functions.Notify(text, "success")
  45.             elseif type == "info" then
  46.                 QBCore.Functions.Notify(text, "primary")
  47.             elseif type == "error" then
  48.                 QBCore.Functions.Notify(text, "error")
  49.             end
  50.         elseif Config.NotificationType == "custom" then
  51.             print("add your notification system! in cl_Utils.lua")
  52.             -- ADD YOUR NOTIFICATION | TYPES ARE info, error, success
  53.         end
  54.     end
  55. end
  56.  
  57. --Blip creating
  58. CreateThread(function()
  59.     for _, v in pairs(Config.Blips) do
  60.         local blip = AddBlipForCoord(v.BlipCoords)
  61.         SetBlipSprite(blip, v.Sprite)
  62.         SetBlipDisplay(blip, v.Display)
  63.         SetBlipScale(blip, v.Scale)
  64.         SetBlipColour(blip, v.Colour)
  65.         SetBlipAsShortRange(blip, true)
  66.  
  67.         BeginTextCommandSetBlipName('STRING')
  68.         AddTextComponentSubstringPlayerName(v.Name)
  69.         EndTextCommandSetBlipName(blip)
  70.     end
  71. end)
  72.  
  73. --Appearance
  74. local appearance = nil
  75. GetSkin = function()
  76.     if Config.Clothing == "fivem-appearance" then
  77.         appearance = exports['fivem-appearance']:getPedAppearance(PlayerPedId())
  78.     elseif Config.Clothing == "esx_skin" then
  79.         TriggerEvent('skinchanger:getSkin', function(skin)
  80.             appearance = skin
  81.         end)
  82.     elseif Config.Clothing == "qb-clothing" then
  83.         -- no need
  84.     elseif Config.Clothing == "custom" then
  85.         print("add your clothing system! in cl_Utils.lua")
  86.         -- ADD YOUR CLOTHING SCRIPT
  87.     end
  88. end
  89.  
  90. ApplySkin = function()
  91.     if Config.Clothing == "fivem-appearance" then
  92.         exports['fivem-appearance']:setPedAppearance(PlayerPedId(), appearance)
  93.     elseif Config.Clothing == "esx_skin" then
  94.         TriggerEvent('skinchanger:loadSkin', appearance)
  95.     elseif Config.Clothing == "qb-clothing" then
  96.         TriggerServerEvent("qb-clothes:loadPlayerSkin")
  97.         TriggerServerEvent("qb-clothing:loadPlayerSkin")
  98.     elseif Config.Clothing == "custom" then
  99.         print("add your clothing system! in cl_Utils.lua")
  100.         -- ADD YOUR CLOTHING SCRIPT
  101.     end
  102. end
  103.  
  104. --
  105. Dispatch = function(coords, type)
  106.     if Config.Dispatch.enabled then
  107.         if Config.Dispatch.script == "cd_dispatch" then
  108.             if type == "drugselling" then
  109.                 local data = exports['cd_dispatch']:GetPlayerInfo()
  110.                 TriggerServerEvent('cd_dispatch:AddNotification', {
  111.                     job_table = { Config.PoliceJobs },
  112.                     coords = coords,
  113.                     title = "10-66 - Suspicious person",
  114.                     message = "Suspicious activity  was spotted by citizen",
  115.                     flash = 0,
  116.                     unique_id = tostring(math.random(0000000, 9999999)),
  117.                     blip = {
  118.                         sprite = sprite,
  119.                         scale = 1.2,
  120.                         colour = 3,
  121.                         flashes = false,
  122.                         text = text,
  123.                         time = (5 * 60 * 1000),
  124.                         sound = 1,
  125.                     }
  126.                 })
  127.             end
  128.         elseif Config.Dispatch.script == "linden_outlawalert" then
  129.             if type == "drugselling" then
  130.                 local data = { displayCode = "10-66", description = "Suspicious person", isImportant = 1,
  131.                     recipientList = Config.PoliceJobs,
  132.                     length = '10000', infoM = 'fa-info-circle', info = "Suspicious activity  was spotted by citizen" }
  133.                 local dispatchData = { dispatchData = data, caller = 'citizen', coords = coords }
  134.                 TriggerServerEvent('wf-alerts:svNotify', dispatchData)
  135.             end
  136.         elseif Config.Dispatch.script == "ps-disptach" then
  137.             if type == "drugselling" then
  138.                 exports['ps-dispatch']:SuspiciousActivity()
  139.             end
  140.         elseif Config.Dispatch.script == "custom" then
  141.             print("add your dispatch system! in cl_Utils.lua")
  142.         end
  143.     end
  144. end
  145.  
  146. if Config.Bob74_ipl then
  147.     Citizen.CreateThread(function()
  148.         BikerMethLab = exports['bob74_ipl']:GetBikerMethLabObject()
  149.  
  150.         -- Here we make two modifications
  151.         BikerMethLab.Style.Set(BikerMethLab.Style.upgrade, false)
  152.         BikerMethLab.Security.Set(BikerMethLab.Security.upgrade, false)
  153.  
  154.         -- But we only call the refresh at the end
  155.         RefreshInterior(BikerMethLab.interiorId)
  156.     end)
  157.  
  158.     Citizen.CreateThread(function()
  159.         BikerCocaine = exports['bob74_ipl']:GetBikerCocaineObject()
  160.         BikerCocaine.Ipl.Interior.Remove()
  161.         -- Here we make two modifications
  162.         BikerCocaine.Style.Set(BikerCocaine.Style.upgrade, false)
  163.         BikerCocaine.Security.Set(BikerCocaine.Security.upgrade, false)
  164.         BikerCocaine.Details.Enable({ BikerCocaine.Details.cokeUpgrade1, BikerCocaine.Details.cokeUpgrade2,
  165.             BikerCocaine.Details.cokeBasic1, BikerCocaine.Details.cokeBasic2, BikerCocaine.Details.cokeBasic3 }, true)
  166.  
  167.         -- But we only call the refresh at the end
  168.         RefreshInterior(BikerCocaine.interiorId)
  169.     end)
  170. end
  171.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement