STG ScriptsDocumentation
3 in 1 Shop

Shops and items

How to add items, categories, item images, weapon stats, store locations and new shop types to STG 3 in 1 Shop.

Everything on this page is done in stg-shop/config.lua and the image folders inside stg-shop/html/assets/. Restart the resource after a change.

Adding an item

Make sure the item exists in your inventory. See Check the items.

Add a line to a category of the shop type in STG.Items:

["supermarket"] = {
    ["Essen"] = {
        { name = "sandwich", label = "Sandwich", price = 15, type = "item" },
    },
},

Add the image as described in Item images.

Every shop type has its own list, so an item only appears in the shop types you add it to.

Categories

Each key inside a shop type is a category. In the supermarket and the black market, every category gets a button next to All Products. Keep category names one word without spaces, for example Drinks or Snacks, or the filter button does not work.

The weapon shop shows all of its weapons in one list with a search bar, so categories there only keep the config tidy.

Weapons

  • In the supermarket and the black market, set type = "weapon" to give the entry as a weapon.
  • The weapon shop always gives a weapon. When the player already owns it, they get one ammoItem instead. Without ammoItem, the purchase does nothing and costs nothing.
["weaponshop"] = {
    ["Pistols"] = {
        { name = "weapon_combatpistol", label = "Combat Pistol", price = 2500, type = "weapon", ammoItem = "pistolammo" },
    },
},

Item images

Images must be .png.

Put one image per item in stg-shop/html/assets/items/, named exactly like the item:

stg-shop/html/assets/items/
├── coffee.png
├── sandwich.png
└── weapon_pistol.png

Weapons sold in the black market use this folder too.

Put two images per weapon in stg-shop/html/assets/img/weapons/, with the weapon name in capital letters:

stg-shop/html/assets/img/weapons/
├── WEAPON_COMBATPISTOL-Mid.png
└── WEAPON_COMBATPISTOL-Big.png

-Mid is shown in the weapon list, -Big in the large preview.

You can copy item images from your inventory, for example ox_inventory/web/images/ or qb-inventory/html/images/. Rename them to match the item name.

Weapon stats

Add an entry to STG.weaponStats with the same weapon name as in STG.Items:

STG.weaponStats = {
    weapon_combatpistol = {
        [1] = { name = "damage", label = "Damage", value = 8, tittle = "DS" },
        [2] = { name = "speed", label = "Speed", value = 6, tittle = "KM/H" },
    },
}

See Weapon stats for every field.

Adding a store location

Stand where players should open the store, usually in front of the counter, and copy your coordinates, for example with /coords or your admin menu.

Stand where the clerk should be and copy your coordinates and heading.

Add a line to STG.Positions. Use the first position as coords, and the clerk position with z lowered by 1 as npcCoord:

{coords = vector3(25.7, -1347.3, 29.49), type = "supermarket", npcCoord = vector4(24.5, -1347.3, 28.5, 270.0)},

Adding a shop type

You can add more shop types next to supermarket, weaponshop and blackmarket, for example a hardware store. Add an entry with the same key to each table, either inside the table or below it like this:

STG.NPC.hardware = "s_m_m_lathandy_01"

STG.Blips.hardware = { label = "Hardware Store", sprite = 59, scale = 0.7, color = 47, visible = true }

STG.description.hardware = "Tools for every job"

STG.Items.hardware = {
    ["Tools"] = {
        { name = "pickaxe", label = "Pickaxe", price = 3500, type = "item" },
    },
}

STG.robReward.hardware = { minMoney = 1000, maxMoney = 2000 }
STG.robItems.hardware = {
    [1] = { item = "water", count = 1, winpercentage = 50 },
}

Then add its locations to STG.Positions with type = "hardware".

  • STG.NPC, STG.Blips, STG.description and STG.Items are needed for the store to open.
  • STG.robReward and STG.robItems are optional. Without them, a robbery of this store pays nothing.
  • New shop types use the supermarket menu with a cart. Only weaponshop uses the weapon shop menu, the weapon license check and STG.weaponshopBlackListJobs.

Still having trouble?

Open a ticket on our Discord. Our team answers around 15 hours a day.

Get help on Discord

On this page