diff --git a/client/banks.lua b/client/banks.lua index cdaa882..4a7fa90 100644 --- a/client/banks.lua +++ b/client/banks.lua @@ -24,22 +24,29 @@ if Config.Banks.enable then jobroles[k] = 0 end end - createCircleTarget( - { name, vec3(v[i].x, v[i].y, v[i].z+0.2), 2.0, { name = name, debugPoly = debugMode, useZ = true, }, }, { - { action = function() + local options = { + { action = function() if Config.General.Peds and isStarted("jim-talktonpc") then exports["jim-talktonpc"]:createCam(Peds[name], true, "generic", true) end TriggerEvent(getScript()..":Client:Bank", { ped = Config.General.Peds and Peds[name] }) end, - icon = "fas fa-piggy-bank", label = locale("target", "bank") }, + icon = "fas fa-piggy-bank", label = locale("target", "bank") + }, + } + if Config.Receipts.CashInAnywhere then + options[#options+1] = { action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = false }) end, icon = "fas fa-receipt", label = locale("target", "cashin_boss"), job = jobroles, - }, + } + options[#options+1] = { action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = true }) end, icon = "fas fa-receipt", label = locale("target", "cashin_gang"), gang = gangroles, - }, - }, 2.5) + } + end + jsonPrint(options) + createCircleTarget( + { name, vec3(v[i].x, v[i].y, v[i].z+0.2), 2.0, { name = name, debugPoly = debugMode, useZ = true, }, }, options, 2.5) if Config.Banks.showBlips then makeBlip({coords = v[i], sprite = 814, col = 2, scale = 0.7, disp = 6, name = locale("blip", "blip_bank") }) end diff --git a/client/tickets.lua b/client/tickets.lua index 17fab80..5bafa7c 100644 --- a/client/tickets.lua +++ b/client/tickets.lua @@ -1,3 +1,46 @@ +if not Config.Banks.enable or not Config.Receipts.CashInAnywhere then + onPlayerLoaded(function() + local locations = BankLocations + if not Config.Receipts.CashInAnywhere then + locations = { + ["receipts"] = Config.Receipts.CashInLocations + } + end + for k, v in pairs(locations) do + for i = 1, #v do + local name = getScript()..":BankLocation:"..k..i + if Config.General.Peds then + if not Config.Gabz then CreateModelHide(v[i].xyz, 1.0, `v_corp_bk_chair3`, true) end + if not Peds[name] then + Peds[name] = makePed(Config.General.PedPool[math.random(1, #Config.General.PedPool)], v[i], false, false) + if isStarted("jim-talktonpc") then + exports["jim-talktonpc"]:createDistanceMessage("hi", Peds[name], 3.0, false) + end + end + end + local jobroles = {} + local gangroles = {} + for k, v in pairs(Config.Receipts.Jobs) do + if v.gang then + gangroles[k] = 0 + else + jobroles[k] = 0 + end + end + createCircleTarget( + { name, vec3(v[i].x, v[i].y, v[i].z+0.2), 2.0, { name = name, debugPoly = debugMode, useZ = true, }, }, { + { action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = false }) end, + icon = "fas fa-receipt", label = locale("target", "cashin_boss"), job = jobroles, + }, + { action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = true }) end, + icon = "fas fa-receipt", label = locale("target", "cashin_gang"), gang = gangroles, + }, + }, 2.5) + end + end + end, true) +end + RegisterNetEvent(getScript()..":Tickets:Menu", function(data) local PlayerInfo = getPlayer() local hasItem, hasTable = hasItem("payticket", 1)