Skip to content

Installation

Folder What it is
sl_gunshop The script
sl_gunshop_mlo Our two Ammu-Nation interiors (the 9 small stores and the 2 big ones with a shooting range), emptied for furniture, with the fixed furniture, the floor and wall finishes and our own props. Required

Inside sl_gunshop, these files are open so you can adapt them:

File What you change there
config.lua Everything: stores, prices, products, license, range, robberies…
locales/en.json, locales/es.json Every text the players see
bridge/ The link to your framework, inventory, weapon license, MDT, police dispatch and robbery minigames
install/ The extra items and their pictures, for ox_inventory (install/ox_inventory/) and qb-core (install/qb-core/)

The rest is protected by the Cfx Asset Escrow: it only runs on a server whose license key belongs to the account that bought it.

Resource Why
One framework: qb-core (QBCore), es_extended (ESX Legacy) or qbx_core (Qbox) Players, money, jobs and the weapon license. Detected automatically
oxmysql Database
An inventory: qb-inventory, ox_inventory or qs-inventory Weapons are items, with their serial number. ESX and Qbox need ox_inventory
MySQL or MariaDB Stores, furniture, stock, sales and the weapon registry

Optional: SL-Interact, ox_target or qb-target (interactions), a police MDT (ps-mdt, kartik-mdt, pure_mdt, piotreq_gpt), a dispatch script, and SL-Courier (player couriers).

Tested with sv_enforceGameBuild 3095. Use that game build or a newer one.

Put both folders in your resources directory, for example inside resources/[ScriptLab]/:

resources/
└── [ScriptLab]/
├── sl_gunshop_mlo/
└── sl_gunshop/

Keep the folder names exactly as they are.

sl_gunshop_mlo goes before sl_gunshop, and both go after your framework, inventory and oxmysql:

ensure oxmysql
ensure qb-core # or es_extended / qbx_core
ensure qb-inventory # or ox_inventory, qs-inventory
ensure sl_gunshop_mlo
ensure sl_gunshop

sl_gunshop_mlo is not optional: the counters, display cases, the floor and the walls of every store are part of it.

  • Ammu-Nation shops of other scripts (qb-shops, esx_shops, the ox_inventory Ammunation shop, qb-weapons shop locations…): remove the Ammu-Nation locations from them, or both scripts will sell in the same place.
  • Other Ammu-Nation MLOs: remove them. SL-Gunshop only works with its own interiors (sl_gunshop_mlo).
  • Store robbery scripts that rob Ammu-Nation registers: turn those locations off. SL-Gunshop has its own robberies.

The weapons, ammunition and attachments are your inventory’s own items (WEAPON_PISTOL, ammo-9, at_suppressor_light… on ox_inventory; weapon_pistol, pistol_ammo, suppressor_attachment… on qb-inventory). Products whose item your inventory does not have are simply not sold. You only need to add these:

Use Items
Products slg_gun_cleaning_kit (the cleaning kit)
Robberies lockpick (registers), stethoscope (safe, not used up), markedbills (the loot on QBCore and Qbox; ESX pays it as black money)
Optional advancedlockpick (works on registers and breaks less)
  • QBCore / qb-inventory: open sl_gunshop/install/qb-core/items.lua, paste the items you are missing into qb-core/shared/items.lua, and copy install/qb-core/images/ into qb-inventory/html/images/.
  • ox_inventory (ESX or Qbox): open sl_gunshop/install/ox_inventory/items.lua, paste its items into ox_inventory/data/items.lua, and copy install/ox_inventory/images/ into ox_inventory/web/images/.
  • qs-inventory: create the items with the same names (they are in install/qb-core/items.lua) and copy the pictures.

Skip the items your server already has.

Restart the whole server (interiors are not loaded with ensure). The database tables are created automatically: there is nothing to import. The stores appear by themselves: Little Seoul and Pillbox Hill are state stores (open, fully fitted and stocked), the other 9 are empty and for sale.

Look at the server console. There must be nothing in red from sl_gunshop or sl_gunshop_mlo; it tells you which framework and inventory were detected.

The admin panel and commands are for your framework’s admins. You can also give them with an ace:

add_ace group.admin slgun.admin allow
  1. Get the weapon license (QBCore/Qbox: metadata licences.weapon; ESX: license weapon).
  2. Walk into the Little Seoul Ammu-Nation. Look at a pistol in the counter and press E (Ask to see it), then Buy. Go to the register and pay. The weapon must be in your inventory with its serial number.
  3. As an admin, type /slgun_serie <serial>: the sale is in the registry.
  4. Open the admin panel with /slgun_admin.

If something fails, see Troubleshooting.

Replace both folders with the new version and restart the whole server. config.lua, locales/ and bridge/ are open files: compare yours with the new ones before replacing them, so you keep your changes. The database updates itself.