Requirements#
| Framework | qbx_core (Qbox). ESX and plain QBCore are not supported. |
| Resources | ox_lib, oxmysql, ox_target, ox_inventory |
| Server | A FiveM server artifact with OneSync enabled. |
| Database | MySQL or MariaDB through oxmysql. The three tables are created on first start. |
| Optional | glitch-xpSystem (levels, XP and perks), glitch-uiElements (contract step list), glitch-minigames (swing minigame), rc-interactions (foreman dialogue), sd-phone (crew groups), qbx_vehiclekeys (truck keys), a fuel script that reads the fuel state bag such as ox_fuel, glitch-pauseMenu (map legend names), glitch-admin (job log), glitch-treasury (shop purchases booked as money leaving the economy), glitch-buffs (fatigue from cutting ore) |
Tested with qbx_core 1.24.0, ox_inventory 2.48.0, ox_lib 3.40.0, ox_target 1.17.2 and oxmysql 2.14.2.
The resource checks for each optional resource at run time. When one is not running, its feature is skipped or falls back to ox_lib, and the rest of the job works as normal. Every call into them sits in server/bridge.lua or client/bridge.lua. Both files are open in the escrow, so you can point the job at another XP system, logger, phone, keys or fuel script.
Installation steps#
Copy the
glitch-miningJobfolder into yourresourcesfolder. The folder name is the resource name and is case-sensitive, so keep it exactly asglitch-miningJob. The service kit item callsglitch-miningJob.useServiceKit, and the rc-interactions flow firesglitch-miningJob:rc:*events, so both break under any other name.Add the items. Paste the entries from
install/items.luaintoox_inventory/data/items.lua:mining_pick,mining_service_kit,raw_ore,ore_sackandwashed_ore. Contracts stay closed untilore_sackandwashed_oreexist, and the server console says so at every start. ox_inventory reads its item list only at start, so restart the server afterwards.Copy the icons. Put the PNGs from
images/intoox_inventory/web/images/. Then setConfig.ImageBaseinconfig/main.lua(see Configuration), because the package default loads icons from the Glitch Studios CDN.Pick a gem item. The Gem assessment perk hands out
Config.Gems.item(diamondby default), which this package does not add. Use an item your server already has, or setitem = false. If the item is missing, the console warns at start and the perk finds nothing.Database. The tables
mining_contracts,mining_entitlementsandmining_veinsare created when the resource starts. If your database user cannot create tables, runinstall/mining.sqlonce by hand.Add the resource to
server.cfg, after ox_lib, oxmysql, qbx_core, ox_inventory and ox_target, and after any optional resources you use:ensure ox_lib ensure oxmysql ensure qbx_core ensure ox_inventory ensure ox_target # optional, only the ones you run ensure glitch-uiElements ensure glitch-minigames ensure glitch-xpSystem ensure glitch-miningJobPick your keys and fuel setup with
Config.VehicleKeysandConfig.Fuel.Optional: import the foreman dialogue. In the rc-interactions editor (
/interactioneditor), importrc-interactions/mining_foreman.jsonand press Save. The job finds the flow by the name inConfig.Interactions.projectName.Check the places. The foreman, truck bay, wash station and 16 veins in
config/locations.luaare set up at the quarry in the Grand Senora Desert under the name Peats Ridge Quarry. Keep them, edit the file, or walk to each spot in the city with/miningadmin. That command saves todata/locations.json, so thedatafolder has to exist and be writable by the server.Give staff the admin command.
/miningadminis restricted togroup.adminthrough the ACEcommand.miningadmin. To give it to another group:add_ace group.mod command.miningadmin allowStart the server and walk up to the foreman. With the dialogue imported the ox_target option is Talk to the foreman, without it Work tablet.
Optional integrations#
glitch-xpSystem: the resource reads levels and XP from the mining category (Config.XPCategory), and these perk effect ids from the mining skill tree:
| Effect id | What it does |
|---|---|
mining_tool |
Wider swing window and less pick wear |
mining_survey |
Rank 1 shows the grade when surveying, rank 2 makes surveys 30% faster |
mining_handling |
One more unit per rank in the ore sack |
mining_wash |
Lower wash rejects |
mining_tailings |
Chance a wash gives one extra unit |
mining_value |
More pay, capped by Config.Pay.perkCap |
mining_coordinator |
The crew washes 2 more units per batch |
mining_deep |
Unlocks the Deep orders |
mining_gem |
Deep orders can turn up Config.Gems.item |
mining_motherlode |
Once a day, every cut from the first rich vein surveyed gives two units |
mining_foreman |
The crew uses the leader's tool and wash perks when they are higher |
Without glitch-xpSystem every player counts as level 1, no XP is given, nobody has perks and the Deep orders stay locked.
glitch-uiElements: draws the contract step list on the side of the screen. Without it the current step shows in the ox_lib text UI (Config.TaskListFallback).
glitch-minigames: the bar-hit swing minigame at a rock face. Without it an ox_lib skill check is used.
rc-interactions: a dialogue with the foreman. Without it, or when the flow is not imported, the foreman has the plain Work tablet and Hand over the ore options.
sd-phone: crews come from the leader's active phone group. Without it every player works solo.
Commands#
| Command | Who | What |
|---|---|---|
/miningadmin |
command.miningadmin (group.admin) |
Move the foreman, truck bay and wash station, add or remove veins, show location labels, testing mode |
miningstatus |
Server console only | Lists every vein and every running contract |
Updating#
Replace everything except config/, locales/ (if you translated or edited text) and data/locations.json, then restart the resource. data/locations.json holds the places saved with /miningadmin, so keep it. Compare the new config/ files and install/items.lua with yours, copy across any new settings or items, and read CHANGELOG.md for changed install steps. The tables are created with CREATE TABLE IF NOT EXISTS, so a restart is enough for the database.