Installation
Requirements
Section titled “Requirements”| Resource | Why |
|---|---|
es_extended (ESX Legacy) |
Framework |
oxmysql |
Database |
screenshot-basic |
Listing photos |
| MySQL or MariaDB | Stores everything |
| Free Imgbb API key | Hosts the photos (how to get it) |
Optional: ox_inventory (detected automatically; its item icons are used too). The standard ESX inventory also works.
Step by step
Section titled “Step by step”1. Download the resource
Section titled “1. Download the resource”After buying, go to portal.cfx.re → Assets → Granted Assets, download sl-marketplace and put the folder in your resources directory (for example resources/[scripts]/sl-marketplace).
Important: the script is protected with Cfx Asset Escrow. It only runs on a server whose licence key (
sv_licenseKey) belongs to the same Cfx account that bought it. Keep the.fxapfile that comes with the resource.
2. Get your Imgbb API key
Section titled “2. Get your Imgbb API key”Listing photos are uploaded to Imgbb, which is free:
- Create an account at imgbb.com.
- Open api.imgbb.com and click Get API key.
- Copy the key; you will use it in step 4.
3. Import the database
Section titled “3. Import the database”Import sql/marketplace.sql into your server’s database (HeidiSQL, phpMyAdmin or the command line):
mysql -u user -p your_database < sql/marketplace.sql4. Configure server.cfg
Section titled “4. Configure server.cfg”Add these lines. The order of the ensure lines matters.
# Photo hosting key (server only — never put it in config.lua)set sl_marketplace_imgbb_key "YOUR_IMGBB_API_KEY"
# Admin panel permission for your staff groupadd_ace group.admin marketplace.admin allow
ensure oxmysqlensure screenshot-basicensure es_extendedensure sl-marketplaceOptional — Discord logs:
set sl_marketplace_discord_webhook "YOUR_DISCORD_WEBHOOK_URL"…and set Config.Discord.Enabled = true in config.lua.
Use
setfor these secrets, neversetrorsets: those would send them to players.
5. Adjust config.lua (optional)
Section titled “5. Adjust config.lua (optional)”The defaults work out of the box. The most common changes:
Config.DefaultLang—'en'(default) or'es'for players who have not chosen a language, and for Discord logs.Config.OpenKey/Config.Command— how players open the marketplace.Config.ServerFee,Config.MinPrice,Config.MaxPrice— your economy.Config.MeetupPoints— where the pickup points are.Config.Gameplay.NPCDelivery— courier cost, insurance and robberies.Config.Notify— plug in your notification system.
6. Start and test
Section titled “6. Start and test”Restart the server and check the console for errors. In game:
- Press F6 (or type
/market) and create your shop. - Publish something and buy it with another player.
- With an admin, type
/marketadmin.
Updating
Section titled “Updating”- Back up your database and your
config.lua. - Replace the resource files, keeping your
config.luaand yourhandlers.luachanges. - Run only the SQL migrations newer than your version, in order (
sql/migrate_*.sql). They live insql/and are named after the version that needs them (migrate_1.15.sql, …). - Read the CHANGELOG: some versions rename settings. Compare your
config.luawith the new one to pick up new options.