From d26e2111547f6de1ab439621521ac72458d81a5f Mon Sep 17 00:00:00 2001 From: Andyauk <47583709+Andyauk@users.noreply.github.com> Date: Thu, 19 Oct 2023 12:51:30 +0100 Subject: [PATCH 1/4] DumpsterStash update --- config.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.lua b/config.lua index 5e566bd..6bd8971 100644 --- a/config.lua +++ b/config.lua @@ -11,6 +11,8 @@ Config = { ProgressBar = "qb", Notify = "qb", + DumpsterStash = true, -- Set to true if you want to turn on the dumpster stashes + Overrides = { ScrapyardSeraching = true, DumpsterDiving = true, From 38853ef5086e6eb8266a84b93eb3169108d0e533 Mon Sep 17 00:00:00 2001 From: Andyauk <47583709+Andyauk@users.noreply.github.com> Date: Thu, 19 Oct 2023 12:53:01 +0100 Subject: [PATCH 2/4] DumpsterStash --- shared/functions.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shared/functions.lua b/shared/functions.lua index b18cdb1..75133fa 100644 --- a/shared/functions.lua +++ b/shared/functions.lua @@ -36,6 +36,8 @@ function makeProp(data, freeze, synced) return prop end +function getCoord(numA, numB) local base = 10^(numB or 0) return math.floor(numA * base + 0.5) / base end + function destroyProp(entity) if Config.Debug then print("^5Debug^7: ^2Destroying Prop^7: '^6"..entity.."^7'") end SetEntityAsMissionEntity(entity) Wait(5) @@ -167,4 +169,4 @@ function progressBar(data) end while result == nil do Wait(10) end return result -end \ No newline at end of file +end From e7b15a08d12a30582eda1487e66e9a1486d85d90 Mon Sep 17 00:00:00 2001 From: Andyauk <47583709+Andyauk@users.noreply.github.com> Date: Thu, 19 Oct 2023 12:54:19 +0100 Subject: [PATCH 3/4] DumpsterStash --- client/dumpsters.lua | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/client/dumpsters.lua b/client/dumpsters.lua index 8ef27d0..74567cf 100644 --- a/client/dumpsters.lua +++ b/client/dumpsters.lua @@ -1,6 +1,29 @@ if Config.DumpsterDiving.Enable then if Config.Debug then print("^5Debug^7: ^2Loading^7: '^6Dumpster Diving^7'") end local Searching = false -- No touch --Dumpster Third Eye + if Config.DumpsterStash then + exports['qb-target']:AddTargetModel(Config.DumpsterDiving.models, + { options = { + { + action = function(entity) TriggerEvent("jim-recycle:Dumpsters:Search", { entity = entity }) end, + icon = "fas fa-dumpster", + label = Loc[Config.Lan].target["search_trash"], + }, + { icon = 'fas fa-dumpster', label = Loc[Config.Lan].target["dump_stash"], action = function(entity) + local DumpsterCoords = GetEntityCoords(entity) + if DumpsterCoords.x < 0 then DumpsterX = -DumpsterCoords.x else DumpsterX = DumpsterCoords.x end + if DumpsterCoords.y < 0 then DumpsterY = -DumpsterCoords.y else DumpsterY = DumpsterCoords.y end + DumpsterX = getCoord(DumpsterX, 1) + DumpsterY = getCoord(DumpsterY, 1) + TriggerEvent("inventory:client:SetCurrentStash", "Dumpster | "..DumpsterX.." | "..DumpsterY) + TriggerServerEvent("inventory:server:OpenInventory", "stash", "Dumpster | "..DumpsterX.." | "..DumpsterY, { + maxweight = 100000, + slots = 10, + }) + end + } + }, distance = 1.5 }) + else exports['qb-target']:AddTargetModel(Config.DumpsterDiving.models, { options = { { @@ -9,6 +32,7 @@ if Config.DumpsterDiving.Enable then if Config.Debug then print("^5Debug^7: ^2Lo label = Loc[Config.Lan].target["search_trash"], }, }, distance = 1.5 }) + end --Search animations local function startSearching(coords) local Ped = PlayerPedId() @@ -83,4 +107,4 @@ if Config.DumpsterDiving.Enable then if Config.Debug then print("^5Debug^7: ^2Lo ClearPedTasks(Ped) end end) -end \ No newline at end of file +end From 7b4ba3d5670926548603518d9c3fadceb940a7d6 Mon Sep 17 00:00:00 2001 From: Andyauk <47583709+Andyauk@users.noreply.github.com> Date: Thu, 19 Oct 2023 12:55:16 +0100 Subject: [PATCH 4/4] DumpsterStash --- locales/en.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/locales/en.lua b/locales/en.lua index 4a3d947..bbc903a 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -29,6 +29,7 @@ Loc["en"] = { ["search"] = "Search", ["drop_off"] = "Drop Off", ["search_trash"] = "Search Trash", + ["dump_stash"] = "Dump Stash", }, menu = { ["close"] = "Close",