Skip to content

Install

Put the cc_pcmining folder in your resources/ (any sub-folder is fine). In server.cfg, after your framework, inventory and cc_lib:

1. The resource

Put the cc_pcmining folder in your resources/ (any sub-folder is fine). In server.cfg, after your framework, inventory and cc_lib:

cfg
ensure ox_lib
ensure oxmysql
ensure cc_lib
# your framework and inventory here
ensure cc_pcmining

The folder must be named cc_pcmining: the NUI and item images load from nui://cc_pcmining/....

2. Items

Add the 30 items to your inventory. Pick the file for yours:

InventoryFileWhere
ox_inventory (Qbox, ESX, ox_core, QBCore with ox)install/items/ox_inventory.luapaste the entries inside return { ... } of ox_inventory/data/items.lua
qb-inventory, ps-inventory, lj-inventoryinstall/items/qb-core.luapaste into QBShared.Items in qb-core/shared/items.lua
qs-inventoryinstall/items/qb-core.luapaste into qs-inventory/shared/items.lua
ESX default inventorynot supporteduse ox_inventory: graphics cards need item metadata (install/items/esx.md)

Images: ox_inventory reads them from this resource (nothing to copy). For the others, copy install/images/*.png into your inventory's image folder (html/images for qb, ps, lj, qs).

Restart the inventory after adding items.

Materials. Refurbishing a dead card and recycling it at the shop use four ordinary items: copper, plastic, aluminum, electronickit (and metalscrap from the top card). If your server calls them something else, rename them in ServerConfig.Refurb.materials and ServerConfig.Scrap (server/config.lua). The console names any that is missing at start.

3. Database

Nothing to do: on start the resource creates and upgrades its tables (all prefixed pcm_). If your database user may not CREATE or ALTER, run sql/cc_pcmining.sql once by hand.

4. Permissions (ACE)

cfg
add_ace group.admin cc_pcmining.admin allow   # /pcmadmin: economy panel, price, pause, calibrate
add_ace group.admin cc_pcmining.wipe allow    # wipe a rig, a warehouse or a wallet (give to fewer people if you like)

5. The exchange pepper (do this before players make codes)

Players open their crypto wallet with a personal 6-digit code. Only a salted hash is stored, mixed with a secret "pepper". Set your own:

cfg
set cc_pcmining_pepper "a-long-random-text-only-you-know"

Use set, never setr. Changing it later means every player must reset their code at the exchange (it costs them the reset fee, ServerConfig.Access).

6. Discord logs (optional)

Four channels: economy, security, admin, work. Either paste the webhook URLs into ServerConfig.Webhooks in server/config.lua (server only, never sent to players), or keep them out of the files with convars:

cfg
set cc_pcmining_webhook_economy "https://discord.com/api/webhooks/..."
set cc_pcmining_webhook_security "..."
set cc_pcmining_webhook_admin "..."
set cc_pcmining_webhook_work "..."

An empty work channel posts to economy. Every row is also kept in the pcm_log table and the admin panel's Activity log (ServerConfig.ActivityLog sets how long).

7. Houses (optional)

Rigs at the server farm need nothing. For rigs in houses, Config.Housing.provider:

  • 'auto' (default): tcc-housing if it is started, else your bridge in custom/server.lua.
  • 'custom': write two functions in custom/server.lua for any housing script:
lua
-- The integer id of the house the player stands in, or nil.
Custom.housingUnit = function(src)
    -- example for a script with an `GetCurrentHouse(src)` export that returns a number:
    -- return exports['my_housing']:GetCurrentHouse(src)
end

-- May this player put a rig in that house (owner or key holder)?
Custom.housingCanBuild = function(src, unit)
    -- return exports['my_housing']:HasKey(src, unit)
end

House ids must be whole numbers. If your housing script names houses by text, map them to a number in your bridge (and keep the map stable: saved rigs remember the number).

8. Locations

Everything is placed on the base map: the PC shop (Little Seoul), the crypto exchange (downtown), the server-farm desk (Cypress Flats) and the warehouses (the base-game executive small warehouse interior, one private routing bucket per rented warehouse). To move one, stand on the spot and run /pcmadmin pos; paste the printed vec4 into config.lua. Inside the warehouse, /pcmadmin calibrate moves slots, screens and props live and saves them to data/calibration.json.

Routing buckets 77001–77008 are used for the warehouses (ServerConfig.Farm.bucketBase). Move the range if another script uses it.

9. Language

set cc_pcmining_locale "en" picks locales/.json. To translate, copy en.json to your code and translate the values (keep the keys and the {placeholders}).

10. Check the console

On start you should see cc_pcmining config OK (... rigs loaded, LGC $...). Any other cc_pcmining config: line names the exact setting to fix. See TROUBLESHOOTING.md.