Installation
Five minutes: one SQL file, one line in config.lua, one line in server.cfg.
Before you start
Section titled “Before you start”| You need | Why |
|---|---|
| lb-phone | The app lives on it |
| oxmysql | Offers, likes and takings are kept in your database |
| ESX, QBCore or QBox | Inventory, money and the player’s identity |
1. Put the folder in place
Section titled “1. Put the folder in place”Drop mic_pawnshop into your resources, for example resources/[mic]/mic_pawnshop.
2. The database
Section titled “2. The database”Import pawnshop.sql from the resource folder once, with HeidiSQL, phpMyAdmin or whatever you use. It creates three tables:
| Table | What it holds |
|---|---|
pawn_offers | Every listing: item, quantity, price, price type, seller, dates and metadata |
pawn_earnings | Each seller’s takings waiting to be cashed out |
liked_offers | Who liked which offer |
The resource does not create them by itself.
It worked when the three tables are in the same database your server uses.
3. Start it after its dependencies
Section titled “3. Start it after its dependencies”In server.cfg, add ensure mic_pawnshop on a line below oxmysql, your framework and lb-phone.
The app waits for lb-phone and adds itself again whenever lb-phone restarts, so a late phone is fine; the framework and oxmysql must be up first.
4. Tell it your framework and inventory
Section titled “4. Tell it your framework and inventory”Open config.lua:
| Option | ESX | QBCore | QBox |
|---|---|---|---|
Config.Framework | "esx" | "qb" | "qb" |
Config.InventoryImagePath | "ox_inventory/web/images/" | "qb-inventory/html/images/" | "ox_inventory/web/images/" |
The framework is not detected, and it is written in lower case. On QBox, use "qb": QBox runs QBCore resources through its compatibility layer. The image path is only for the pictures in the app — any inventory works, as long as the path points at the folder where its item images are.
5. Items
Section titled “5. Items”There are none to add. The app sells whatever players already carry. Anything you never want traded goes in Config.BlackList (see Customization).
6. First test
Section titled “6. First test”- Open lb-phone. Pawn Shop is on the home screen already — it is installed by default.
- Create an offer: pick an item from your inventory, set a quantity and a price, and choose Unit or Total.
- On a second character, open the app and buy it.
It worked when the item leaves the seller’s inventory when the offer is posted, arrives in the buyer’s when it is bought, and the seller sees the money under Pending at the top of the app, ready to transfer.
Before you open your city
Section titled “Before you open your city”- Decide where the money comes from.
Config.Bank = trueuses bank accounts. Paying in items needs money to be an inventory item — read Customization first. - Set
Config.Expireknowingly. An offer that expires is removed with its items; they do not go back to the seller. - Fill
Config.BlackListwith anything that must not change hands: the shipped list only holdsburgerandweapon_appistolas examples. - Move the pawn shop to where you want it, if you turn on
Config.RequireLocation.