v2.1.37 feature
Job and gang access for farms, labs and dealers, plus harvesting tools
8changes

Job and gang access for farms, labs and dealers, plus harvesting tools
8changes

[02] Release
Restrict any farm, laboratory or dealer to chosen jobs or gangs with a minimum grade, straight from the creator, and every action is checked on the server. Drug types can now require a tool to harvest, and the console tells you when a new version is out.
Nothing to do in the database. The new access column is added to drug_farm, drug_labs and drug_seller the first time the script starts. Do not import the [sql] files again: they recreate the tables and delete every farm, lab and dealer you have.
After replacing the files, run refresh before ensure qs-drugs-creator (or restart the server). The resource has a new server file, and a plain restart keeps the old file list.
Your existing farms, labs and dealers stay open to everyone until you add a restriction to them in /drugcreator.
Gang restrictions use QBCore and Qbox gangs, or the organizations of qs-crime-creator on ESX. Without either, the gang list in the creator is empty and only job restrictions are available.
To require a tool, set requireTool = 'item_name' on a drug type in Config.CollectItems and add that item to your inventory. The tool is never removed.
Replace every file in the resource. If you edited any of these, merge your changes into the new version, because the script needs the new functions in them:
custom/esx/client.lua and custom/esx/server.luacustom/qb/client.lua and custom/qb/server.luashared/main.luaclient/custom/target/main.luaconfig/main.lua (new requireTool option) and config/furniture.lualocales/* (new texts)server/updater.lua is new and server/version.lua was removed.
A new Access Restrictions panel when creating or editing a farm, laboratory or dealer: choose the jobs and gangs allowed to use it, each with a minimum grade. Leave both lists empty and everyone can use it, as before.
Harvesting, buying a lab, entering it, processing, MLO doors and selling to a dealer are all validated on the server. Players without access do not see its blip or its prompt. Police can still raid an unlocked lab.
QBCore and Qbox use their own gangs and grades. On ESX, the organizations of qs-crime-creator are used as gangs, without a minimum grade.
New requireTool option per drug type in Config.CollectItems: players must carry that item to harvest. It is only checked, never removed, and a message tells the player which tool they need.
On start, the server console shows your version, the latest one, what changed and how to update. It checks again every 30 minutes.
The new access column is added automatically on start. The [sql] files include it for new installs.
Access panel, no-access and missing-tool messages.
Replaced by the new update notices.