Skip to content

Installation

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.

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 .fxap file that comes with the resource.

Listing photos are uploaded to Imgbb, which is free:

  1. Create an account at imgbb.com.
  2. Open api.imgbb.com and click Get API key.
  3. Copy the key; you will use it in step 4.

Import sql/marketplace.sql into your server’s database (HeidiSQL, phpMyAdmin or the command line):

Terminal window
mysql -u user -p your_database < sql/marketplace.sql

Add these lines. The order of the ensure lines matters.

server.cfg
# 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 group
add_ace group.admin marketplace.admin allow
ensure oxmysql
ensure screenshot-basic
ensure es_extended
ensure sl-marketplace

Optional — Discord logs:

server.cfg
set sl_marketplace_discord_webhook "YOUR_DISCORD_WEBHOOK_URL"

…and set Config.Discord.Enabled = true in config.lua.

Use set for these secrets, never setr or sets: those would send them to players.

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.

Restart the server and check the console for errors. In game:

  1. Press F6 (or type /market) and create your shop.
  2. Publish something and buy it with another player.
  3. With an admin, type /marketadmin.
  1. Back up your database and your config.lua.
  2. Replace the resource files, keeping your config.lua and your handlers.lua changes.
  3. Run only the SQL migrations newer than your version, in order (sql/migrate_*.sql). They live in sql/ and are named after the version that needs them (migrate_1.15.sql, …).
  4. Read the CHANGELOG: some versions rename settings. Compare your config.lua with the new one to pick up new options.