diff --git a/client/dumpsters.lua b/client/dumpsters.lua index ed908e1..9b4b9c2 100644 --- a/client/dumpsters.lua +++ b/client/dumpsters.lua @@ -13,13 +13,29 @@ local dumpsters = { -- The mighty list of dumpters/trash cans `zprop_bin_01a_old`, `hei_heist_kit_bin_01`, `ch_prop_casino_bin_01a`, `vw_prop_vw_casino_bin_01a`, `mp_b_kit_bin_01`, `prop_bin_01a`, } ---Loading/Unloading Asset Functions -function loadAnimDict(dict) if Config.Debug then print("^5Debug^7: ^2Loading Anim Dictionary^7: '^6"..dict.."^7'") end while not HasAnimDictLoaded(dict) do RequestAnimDict(dict) Wait(5) end end -function unloadAnimDict(dict) if Config.Debug then print("^5Debug^7: ^2Removing Anim Dictionary^7: '^6"..dict.."^7'") end RemoveAnimDict(dict) end +function getCoord(numA, numB) local base = 10^(numB or 0) return math.floor(numA * base + 0.5) / base end +--Dumpster Third Eye CreateThread(function() - --Dumpster Third Eye - exports['qb-target']:AddTargetModel(dumpsters, { options = { { event = "jim-recycle:Dumpsters:Search", icon = "fas fa-dumpster", label = Loc[Config.Lan].target["search_trash"], }, }, distance = 1.5 }) + if Config.DumpsterStash then + exports['qb-target']:AddTargetModel(dumpsters, { options = { { event = "jim-recycle:Dumpsters:Search", 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(dumpsters, { options = { { event = "jim-recycle:Dumpsters:Search", icon = "fas fa-dumpster", label = Loc[Config.Lan].target["search_trash"], }, }, distance = 1.5 }) + end end) --Search animations diff --git a/client/scrap.lua b/client/scrap.lua index 19b9129..a8886b7 100644 --- a/client/scrap.lua +++ b/client/scrap.lua @@ -12,10 +12,6 @@ local scrap = { -- The mighty list of dumpters/trash cans `prop_rub_wreckage_8`, `prop_rub_wreckage_9`, `ch1_01_sea_wreck_3`, `cs2_30_sea_ch2_30_wreck005`, `cs2_30_sea_ch2_30_wreck7`, `cs4_05_buswreck`, } ---Loading/Unloading Asset Functions -local function loadAnimDict(dict) if Config.Debug then print("Debug: Loading Anim Dictionary: '"..dict.."'") end while not HasAnimDictLoaded(dict) do RequestAnimDict(dict) Wait(5) end end -local function unloadAnimDict(dict) if Config.Debug then print("Debug: Removing Anim Dictionary: '"..dict.."'") end RemoveAnimDict(dict) end - CreateThread(function() --Dumpster Third Eye exports['qb-target']:AddTargetModel(scrap, { options = { { event = "jim-recycle:Scrap:Search", icon = "fas fa-dumpster", label = Loc[Config.Lan].target["search"], }, }, distance = 1.5 }) diff --git a/config.lua b/config.lua index a5b1e08..4adc073 100644 --- a/config.lua +++ b/config.lua @@ -13,6 +13,7 @@ Config = { OpenHour = 9, -- From what hour should the pawnshop be open? CloseHour = 21, -- From what hour should the pawnshop be closed? PayAtDoor = nil, -- Set to nil stop turn this off, set to a number to enable + DumpsterStash = false -- Set to true if you want to turn on the dumpster stashes Minigame = "qb-skillbar", -- Enable minigame when searching. qb-skillbar/qb-lock/ps-ui diff --git a/locales/cn.lua b/locales/cn.lua index f061876..c2099f0 100644 --- a/locales/cn.lua +++ b/locales/cn.lua @@ -28,7 +28,8 @@ Loc["cn"] = { ["sell_bottles"] = "出售瓶子", ["search"] = "搜索", ["drop_off"] = "放下", - ["search_trash"] = "搜索垃圾", + ["search_trash"] = "搜索垃圾箱", + ["dump_stash"] = "扔些东西进去...", }, menu = { ["close"] = "关闭", diff --git a/locales/en.lua b/locales/en.lua index 540722c..9d69dc2 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"] = "Throw something in there..", }, menu = { ["close"] = "Close",