Code Monkey home page Code Monkey logo

jim-recycle's Introduction

jim-recycle

FiveM Custom QBCORE recycling script made by me from scratch

  • Highly customisable via config.lua

    • Locations are easily changeable/removable
  • Features several ways to get materials

    • Recycle Center - Trade recyclable Materials to get crafting materials
    • Dumpster Diving - Search dumpsters and trash cans for materials
    • Scrapping - Search wrecked vehicles for scraps
  • Customisable points for Selling materials

    • Add a Location for an ore to the config and it will use this location for both qb-target and a prop
    • Can place them anywhere, doesn't have to be just one mining location
    • I opted for a drilling animation as opposed to the pickaxe swinging
    • Nicely animated for better immersion
  • NPC's spawn on the blip locations

    • These locations can also give third eye and select ones have context menus for selling points
  • Features simplistic built in crafting that uses recipes in the config.lua

Video Previews

Dependencies

  • qb-menu - for the menus
  • qb-target - for the third eye selection

How to install

If you want to use your own items or repurpose this script:

  • Place in your resources folder
  • add the following code to your server.cfg/resources.cfg below [qb]
ensure jim-recycle

Item installation

  • Add the images to your inventory folder
    • for example: [qb] > qb-inventory > html > images
  • This script supports automatic installation of items to items.lua with newer QBCore exports
    • You still need to install images
  • If you're having issues or your core doesn't support this then, put these lines in your items.lua
-- Jim-Recycle Items
["recyclablematerial"]  = {["name"] = "recyclablematerial",   ["label"] = "Recycle Box",      ["weight"] = 100, ["type"] = "item", 		["image"] = "recyclablematerial.png",   ["unique"] = false, 	["useable"] = false, 	["shouldClose"] = false, ["combinable"] = nil,   ["description"] = "A box of Recyclable Materials"},
["bottle"]              = {["name"] = "bottle",               ["label"] = "Empty Bottle",     ["weight"] = 10,  ["type"] = "item", 		["image"] = "bottle.png",               ["unique"] = false, 	["useable"] = false, 	["shouldClose"] = false, ["combinable"] = nil,   ["description"] = "A glass bottle"},
["can"]                 = {["name"] = "can",                  ["label"] = "Empty Can",        ["weight"] = 10,  ["type"] = "item", 		["image"] = "can.png",                  ["unique"] = false, 	["useable"] = false, 	["shouldClose"] = false, ["combinable"] = nil,   ["description"] = "An empty can, good for recycling"},

jim-recycle's People

Contributors

holidayy95 avatar jimathy avatar noobysloth avatar qwerty1verified avatar vosscat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

jim-recycle's Issues

scrap search issue

current lines.

elseif Config.Minigame == "ps-ui" then
exports['ps-ui']:Circle(function(success)
if success then
TriggerEvent("QBCore:Notify", Loc[Config.Lan].success["get_trash"], "success")
startSearching(GetEntityCoords(dumpster))
searched[i+1] = dumpster
else
TriggerEvent("QBCore:Notify", Loc[Config.Lan].error["nothing"], "error")
searched[i+1] = dumpster
ClearPedTasks(PlayerPedId())
end
end, 2, 15) -- NumberOfCircles, MS
end
break
end
end
end
end
end
end)

changed to

elseif Config.Minigame == "ps-ui" then
exports['ps-ui']:Circle(function(success)
if success then
TriggerEvent("QBCore:Notify", Loc[Config.Lan].success["get_scrap"], "success")
startSearching(GetEntityCoords(scrapped))
searched[i+1] = scrapped
else
TriggerEvent("QBCore:Notify", Loc[Config.Lan].error["nothing"], "error")
searched[i+1] = scrapped
ClearPedTasks(PlayerPedId())
end
end, 2, 15) -- NumberOfCircles, MS
end
break
end
end
end
end
end
end)

or else user can search scrap unlimited times since the the line is looking for searched dumpsters rather then searched scrap. Changes fix the issue for possible abuse.

searched[i+1] = scrapped

Reliable network event overflow

One of my players is complaining that every time they sell up in Paleto Bay, they encounter an error called "Reliable Network Event Overflow," and they get kicked from the server. We just can't understand why this is happening. Is there something you could check on this?

When you sell between 700 and over 1000 then you get Reliable Network Event Overflow it makes no sense you should get it must be fixed

new qbcore

I pray for the day this works with the new qb update

Even trade for Materials

Is there a way to make it where I get a even trade for matrerials. If I go to the ped with 100 material, i will get back 100 items

problem in my main city

i dont know what has happened but when i put your script into my main server its telling that it couldnt make a hard link to the stream -manifest.ymf i put this script into my dev server and it works perfectly well i dont understand why it doesnt work in the main can you please help me thank you

Add qbtarget as true or false

Depending on how a server is set up, recycling can become a-bit of a task when using qbtarget(third eye), is there any chance you make it about like qb-recyclejob were you use your E key instead, thank you

Infinite scrapping when using ps-ui

                    elseif Config.Minigame == "ps-ui" then
                        exports['ps-ui']:Circle(function(success)
                            if success then
                                TriggerEvent("QBCore:Notify", Loc[Config.Lan].success["get_trash"], "success")
                                startSearching(GetEntityCoords(dumpster))
                                searched[i+1] = dumpster
                            else
                                TriggerEvent("QBCore:Notify", Loc[Config.Lan].error["nothing"], "error")
                                searched[i+1] = dumpster
                                ClearPedTasks(PlayerPedId())
                           end
                        end, 2, 15) -- NumberOfCircles, MS

Above Code needs to be replaced with below:

                    elseif Config.Minigame == "ps-ui" then
                        exports['ps-ui']:Circle(function(success)
                            if success then
                                TriggerEvent("QBCore:Notify", Loc[Config.Lan].success["get_scrap"], "success")
                                startSearching(GetEntityCoords(scrapped))
                                searched[i+1] = scrapped
                            else
                                TriggerEvent("QBCore:Notify", Loc[Config.Lan].error["nothing"], "error")
                                searched[i+1] = scrapped
                                ClearPedTasks(PlayerPedId())
                            end
                        end, 2, 15) -- NumberOfCircles, MS

QB-Menu clash

Looked over and over and couldn't for the life of me find a fix

MainThrd/ ^1SCRIPT ERROR: @jim-recycle-main/client/client.lua:437: No such export openMenu in resource qb-menu^7

trading issue

when you trade the matrial you drop it at same time you lose the matrial

Uploading Desktop 2023.03.10 - 17.14.26.01_Trim.mp4โ€ฆ

when signing out

When signing off duty you cant leave the building

[ 845109] [b2699_GTAProce] MainThrd/ ^1SCRIPT ERROR: @jim-recycle/shared/functions.lua:19: attempt to concatenate a nil value (local 'entity')^7
[ 845109] [b2699_GTAProce] MainThrd/ ^3> destroyProp^7 (^5@jim-recycle/shared/functions.lua^7:19)
[ 845109] [b2699_GTAProce] MainThrd/ ^3> EndJob^7 (^5@jim-recycle/client/client.lua^7:233)
[ 845109] [b2699_GTAProce] MainThrd/ ^3> handler^7 (^5@jim-recycle/client/client.lua^7:299)
[ 845109] [b2699_GTAProce] MainThrd/ ^3> fn^7 (^5@qb-target/client.lua^7:1168)

Desktop Screenshot 2023 03 27 - 17 19 43 88

qb target not working

everything is working peds , duty with target but packages are not working you cant grab them target is not working if you can help me

Script Error

jim-recycle/clinet/clinet.lua:309: attempt to concatenate a nil value (global 'amount')

hanlder (jim-recycle/clinet/client/client.lua:309
fn (qb-target/client.lua:1168

jims recycle

I can third eye the guy to trade materials but cant open the menu to swap them

[Bug?] Opening Hours not stopping use?

So it seems in other scripts that work like this recycling job, that when the time gets to the closing time, it stops players from continuing to search, a notificaiton comes up saying "Time to clock off" or similar, they log off duty at the computer then exit warehouse and that's it until the doors open again at the start time.

Whats the intention of the config for open/close? it mentions "pawn shop" but I assume you mean the trader that takes items?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.