Installation
What is in the package
Section titled “What is in the package”| 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.
Requirements
Section titled “Requirements”| 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.
Installation, step by step
Section titled “Installation, step by step”Step 1 · Copy the folders
Section titled “Step 1 · Copy the folders”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.
Step 2 · Add them to server.cfg
Section titled “Step 2 · Add them to server.cfg”sl_gunshop_mlo goes before sl_gunshop, and both go after your framework, inventory and oxmysql:
ensure oxmysqlensure qb-core # or es_extended / qbx_coreensure qb-inventory # or ox_inventory, qs-inventoryensure sl_gunshop_mloensure sl_gunshopsl_gunshop_mlo is not optional: the counters, display cases, the floor and the walls of every store are part of it.
Step 3 · Turn off what would clash
Section titled “Step 3 · Turn off what would clash”- Ammu-Nation shops of other scripts (
qb-shops,esx_shops, theox_inventoryAmmunation shop,qb-weaponsshop 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.
Step 4 · Add the items
Section titled “Step 4 · Add the items”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 intoqb-core/shared/items.lua, and copyinstall/qb-core/images/intoqb-inventory/html/images/. - ox_inventory (ESX or Qbox): open
sl_gunshop/install/ox_inventory/items.lua, paste its items intoox_inventory/data/items.lua, and copyinstall/ox_inventory/images/intoox_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.
Step 5 · Start the server
Section titled “Step 5 · Start the server”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.
Step 6 · Give the staff permissions
Section titled “Step 6 · Give the staff permissions”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 allowCheck that it works
Section titled “Check that it works”- Get the weapon license (QBCore/Qbox: metadata
licences.weapon; ESX: licenseweapon). - 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.
- As an admin, type
/slgun_serie <serial>: the sale is in the registry. - Open the admin panel with
/slgun_admin.
If something fails, see Troubleshooting.
Updating
Section titled “Updating”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.