Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option for dumpster stash. #11

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions client/dumpsters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions client/scrap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down
1 change: 1 addition & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion locales/cn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ Loc["cn"] = {
["sell_bottles"] = "出售瓶子",
["search"] = "搜索",
["drop_off"] = "放下",
["search_trash"] = "搜索垃圾",
["search_trash"] = "搜索垃圾箱",
["dump_stash"] = "扔些东西进去...",
},
menu = {
["close"] = "关闭",
Expand Down
1 change: 1 addition & 0 deletions locales/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down