Parts
Community-driven mechanic parts store. Players craft real GR1M_Mech items in GR1M_Craft, sell them to an admin-placed ped for cash, and mechanics buy that location's stock with cash or bank.
#Requirements
oxmysql,ox_lib,ox_inventory,GR1M_Bridge(free)- Qbox, QBCore or ESX Legacy
- Optional:
ox_target(marker + E fallback if missing) - Optional:
GR1M_Craft(recipes upserted on boot) - Optional:
GR1M_Mech(mechanic job check). If Mech is stopped,Config.FallbackMechanicJobsis used.
#Install
- Folder must be named
GR1M_Parts. - Schema auto-creates on first boot (or import
sql/install.sql). - Catalog rows are seed only. After
gr1m_parts_cataloghas rows, the database is the source of truth. Empty that table if you want config seeds to load again. - Apply
server.cfg:
add_ace group.admin gr1mparts.admin allow
ensure oxmysql
ensure ox_lib
ensure qbx_core # or qb-core / es_extended
ensure GR1M_Bridge
ensure ox_inventory
ensure ox_target
ensure GR1M_Craft
ensure GR1M_Mech
ensure GR1M_Parts
#Player flow
- Anyone can sell catalog items at the ped. Payout is cash. Stock increases at that location only. Crafting ranks (
parts_sell_bonus) raise that payout (capped, server-side). - Only players with a GR1M_Mech owned-shop job can buy. Duty is not required. Pay with cash or bank. Mechanics ranks (
parts_buy_discount) lower that cost. The UI shows the player's actual prices. - A skilled sell can never meet or exceed that same player's skilled buy price.
- Stock starts at 0. If nobody crafts and sells, mechanics have nothing to buy (unless you restock in admin).
- Sell/buy do not grant GR1M_Skills XP. Crafting XP is
craft_completewhen the part is made.
mechanic_tablet and empty_nitrous_bottle are not in the public catalog.
#Admin
/gr1mparts — framework admins, ACE command, gr1m.admin or gr1mparts.admin.
- Locations — CRUD, ped model, scenario, blip, and which catalog parts this ped sells. Shops stay enabled unless you uncheck Enabled and save. Place ped at look-at raycasts the ground/wall in front of the camera; left-click confirms (E still works). Heading is the way you are facing. Also Use my position (snaps Z to the ground).
- Catalog — add/remove parts, sell/buy prices (
sellmust be belowbuy), recipe inputs (at least 4 distinct item ids), craft time. Parts stay enabled unless you uncheck Enabled and save. Saving a catalog row upsertsmechpart_<item>into GR1M_Craft. Searchable item fields use the ox inventory list. - Stock — per location, set counts from the location editor.
Select all parts (the default) so new catalog items appear at that store automatically. A subset is a whitelist. Select none to sell nothing there. The server enforces the allowlist on sell, buy, and the player catalog.
Never trust NUI: every sell/buy re-checks distance, catalog, location allowlist, stock, inventory, and money on the server.
#Crafting
Recipes use category mechanic_parts and kind mechanic on GENERAL_3D_TABLE. Every craftable part requires at least 4 distinct input items. Live catalog rows under that floor are padded on boot (existing ingredients stay; unused seed materials then screws/scrap/spring/… fill the rest) and re-upserted into GR1M_Craft.
They are not assigned to a world table automatically. In /gcadmin → TEMPLATES, stamp Mechanic Parts Bench at your position. That template assigns every mechanic_parts recipe.
Imported Craft recipes named mechanic_engine_oil (etc.) are a different item id and will not install in GR1M_Mech. Use these mechpart_* outputs (engine_oil, i4_engine, …).
#Tip
If you want players to be the only source of parts, remove the shops blocks from GR1M_Mech's shop config so they don't undercut this market with infinite stock.
#Permissions
add_ace group.admin gr1mparts.admin allow
GR1M