πŸ“Installation

Installation of the script β€’ Tutorials and explenations down below

Importing inventory images to the store script: Location: scriptfolder/html/js/Shoptemp_open.js Line: 39 and 40

// DO NOT COPY THIS LINE - OX Inventory Example
<img src="nui://ox_inventory/web/images/${name}.png" 
${isBlackMoney ? `data-tooltip="${tooltipText}"` : ''} />

// DO NOT COPY THIS LINE - QB - Inventory example
<img src="nui://qb-inventory/html/images/${name}.png"
${isBlackMoney ? `data-tooltip="${tooltipText}"` : ''} />

// For other inventories, set the line as shown above
<img src="nui://your-inventory-folder-name/whateverfolder/images-folder-name/${name}.imagetype"
${isBlackMoney ? `data-tooltip="${tooltipText}"` : ''} />

Definitions and Explenations

Config definition
Explenation
Enable/Disable

DisplayName

Store name shown in UI

-

PaymentID

Store sells and buys items in this payment ID (type)

β€’ PaymentID = 1 --cash /money β€’ PaymentID = 2 -- bank β€’ PaymentID = 3 -- black money

Distancetoseller

distance from how far will textui appear and shop can be opened, default is set to 1.5 units

-

Restartrefresh

if the shop stock should be refreshed back to default amounts after server/script restart

true/false

IsUnlimited

Should this store have stock limit? (if no limit you can buy or sell infinite amount of items defined in the config to this store)

true/false

Nobuying

Should this store have buy tab, if set to true, you are only able to sell items to this store, buying option is removed

true/false

Position

Position of the store, where you are able to open it and see the textui to open it.

-

BlipSettings

Can change store blip ID, size, colour and add name for the blip

BipSettings = false

SellerNPC

Can add desired ped to the store location, can make spawned ped play chosen animation. Also animation for the ped can be disabled.

β€’ SellerNPC = false β€’ Animation = false β€’ Model = nil

Bprice

Price, that shop asks for the item.

β€’ Static: Bprice = 57 β€’ Random: Bprice = math.random(57, 60) β€’ Shop not buying the item: Bprice = nil

Sprice

Price, that you will get for selling the item to the store.

β€’ Static: Sprice = 57 β€’ Random: Sprice = math.random(57, 60) β€’Shop not selling the item: Sprice = nil

Defaultamount

The amount of the item that store will start on first placement or after every data wipe, if Restartrefresh is set to true, or manually deleteing from the saveddata folder.

Can be set to 0, until someone sells the item to the store.

sellJob

The name of the jobs that can access this shop's sell option. Money goes to the society

sellJob = false or remove it from the list as examples down below do not have them in it

MaxAmount

Maximum amount of the item that store stock can hold. (Limits amount of items, that player can sell or buy from the store), every item maximum amount can be set separately.

If IsUnlimited is set to true, then this store wont have stock limit at all, and from the shop placement items can be bought from there.

Store examples:

--- Random and static price examples included as well 
--- (Bank Payment example can be changed from PaymentID)

Config.Storelist = {
['example-shop-no-ped-no-blip'] = { -- Shop ID
        DisplayName = "exampleshopnopednoblip", -- Name displayed for the shop
        PaymentID = 2, -- Payment Styles (selling and buying): 1 = cash, 2 = bank, 3 = black money
        Distancetoseller = 1.5,  --- Distance that opens TextUI and you are able to open the shop
        Restartrefresh = false, --- should store stock be wiped on server restart?
        IsUnlimited = false, -- Controls if items can be bought/sold without limit (stock)
        Nobuying = false,--- If true shop does not have buy option, you can only sell items there!
        Position = vector3(707.0936, -960.8204, 30.3953), -- Store location
        BlipSettings = false,
        SellerNPC = false,
        items = { -- Items available for sale or buying in the shop
            ['rolex'] = { -- Item name (same as used for item spawning, name, not label)
            ItemLabel = "Rolex", -- Label for the item
            Defaultamount = 2, --- Amount of this item that shop has by default
            BPrice = math.random(85, 105), -- Random buy price for the item (set this to nil you you do not want shop to sell this item)
            MaxAmount = 20, -- Maximum stock the shop can hold of this item
            SPrice = math.random(57, 77) -- Random sell price for the item (set this to nil if you do not want shop to buy this item)
            },
            ['gold_bar'] = { -- Item name (same as used for item spawning, name, not label
            ItemLabel = "Gold bar", -- Label  for the item
            Defaultamount = 2, --- Amount of this item that shop has by default
            BPrice = 85, -- Static buy price for the item (set this to nil you you do not want shop to sell this item)
            MaxAmount = 20, -- Maximum stock the shop can hold of this item
            SPrice = 77 -- Static sell price for the item (set this to nil if you do not want shop to buy this item)
            },
            ['bluediamond'] = { -- Item name (same as used for item spawning, name, not label
            ItemLabel = "Blue diamond", -- Label  for the item
            Defaultamount = 2, --- Amount of this item that shop has by default
            BPrice = math.random(85, 105), -- Random buy price for the item (set this to nil you you do not want shop to sell this item)
            MaxAmount = 20, -- Maximum stock the shop can hold of this item
            SPrice = nil -- If This is set to nil, then this item can not be sold to this store
            },
            ['pinkdiamond'] = { -- Item name (same as used for item spawning, name, not label
            ItemLabel = "Pink Diamond", -- Label for the item
            Defaultamount = 2, --- Amount of this item that shop has by default
            BPrice = nil, -- If This is set to nil, then this item can not be bought from this store
            MaxAmount = 20, -- Maximum stock the shop can hold of this item
            SPrice = 100-- If This is set to nil, then this item can not be sold to this store
            },
        },
    },
}


 

Built to update and extend shops system created by: K5

Last updated