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
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
},
},
},
}
--- (Cash/Money Payment example can be changed from PaymentID)
Config.Storelist = {
['cleanpwnshop'] = { -- Shop ID
DisplayName = "Pawnshop", -- Name displayed for the shop
PaymentID = 1, -- 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 = true, --- 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(713.0685, -967.4807, 30.3953), -- Store location
BlipSettings = { -- Blip creation (Set this as false if you do not want a blip)
SpriteID = 272, -- Sprite ID for the blip
ScaleFactor = 1.0, -- Size of the blip on the map
StoreBlipName = "Pawnshop" --- Blip name
},
SellerNPC = { -- Seller NPC Configuration
Model = 'cs_carbuyer', -- NPC model (set to nil if you do not want to have a ped)
Location = vector3(713.0685, -967.4807, 29.3953), -- NPC Spawn location
HeadingDirection = 349.6501, -- NPC Heading
Animation = {
Dict = "amb@world_human_hang_out_street@female_arms_crossed@idle_a", -- Animation dictionary for NPC
Name = "idle_a" -- Name of the animation to play
}
},
items = { -- Items available for sale or buying in the sho
['goldbull'] = { -- Item name (same as used for item spawning, name, not label
ItemLabel = "Gold coins", -- 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 labeln
ItemLabel = "Gold bar", -- 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)
},
['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 = math.random(57, 77) -- Random sell price for the item (set this to nil if you do not want shop to buy this item)
},
['diamond'] = { -- Item name (same as used for item spawning, name, not label
ItemLabel = "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 = math.random(57, 77) -- Random sell price for the item (set this to nil if you do not want shop to buy this item)
},
['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 = 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)
},
['panther'] = { -- Item name (same as used for item spawning, name, not label
ItemLabel = "Panther statue", -- 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)
},
['pbottle'] = { -- Item name (same as used for item spawning, name, not label
ItemLabel = "Expensive bottle", -- 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)
},
['pnecklace'] = { -- Item name (same as used for item spawning, name, not label
ItemLabel = "Expensive necklace", -- 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)
},
['pmonkey'] = { -- Item name (same as used for item spawning, name, not label
ItemLabel = "Monkey statue", -- 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)
},
['necklace'] = { -- Item name (same as used for item spawning, name, not label
ItemLabel = "Necklace", -- 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)
},
['ring'] = { -- Item name (same as used for item spawning, name, not label
ItemLabel = "Ring", -- 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)
},
['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)
},
},
},
}
--- (Black money Payment example can be changed from PaymentID)
Config.Storelist = {
['shadypawnshop'] = { -- Shop ID
DisplayName = "Dirty Pawnshop", -- Name displayed for the shop
PaymentID = 3, -- 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 = true,--- If true shop does not have buy option, you can only sell items there!
Position = vector3(706.1038, -965.5582, 30.4129), -- Store location
BlipSettings = { -- Blip creation (Set this as false if you do not want a blip)
ColorID = 1, -- Color for the shop blip
SpriteID = 272, -- Sprite ID for the blip
ScaleFactor = 1.0, -- Size of the blip on the map
StoreBlipName = "Dirty Pawnshop" --- Blip name
},
SellerNPC = { -- Seller NPC Configuration
Model = 'a_m_y_soucent_02', -- NPC model (set to nil if you do not want to have a ped)
Location = vector3(706.1038, -965.5582, 29.4129), -- NPC Spawn location
HeadingDirection = 285.1291, -- NPC Heading
Animation = {
Dict = "amb@world_human_aa_smoke@male@idle_a", -- Animation dictionary for NPC
Name = "idle_a" -- Name of the animation to play
}
},
items = { -- Items available for sale or buying in the shop
['goldbull'] = { -- Item name (same as used for item spawning, name, not label
ItemLabel = "Gold coins", -- 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 = 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)
},
},
},
}
Config.Storelist = {
['jobexample'] = {
DisplayName = "BurgerShot",
sellJob = {'burgershot'}, -- The name of the jobs that can access this shop's sell option. Money goes to the society
Position = vector3(-1198.8856201172, -882.81433105469, 13.348832130432),
BlipSettings = { -- Blip creation (set this to false if do not want a blip)
ColorID = 75, -- Color for the shop blip
SpriteID = 103, -- Sprite ID for the blip
ScaleFactor = 1.0, -- Size of the blip on the map
StoreBlipName = "Burgershot" --- Blip name
},
SellerNPC = { -- Seller NPC Configuration
Model = 'csb_burgerdrug', -- NPC model (set to nil if you do not want to have a ped)
Location = vector3(-1198.7757568359, -882.98065185547, 12.349102020264), -- NPC Spawn location
HeadingDirection = 34.899082183838, -- NPC Heading
Animation = {
Dict = "amb@world_human_hang_out_street@female_arms_crossed@idle_a", -- Animation dictionary for NPC
Name = "idle_a" -- Name of the animation to play
}
},
PaymentID = 1,
items = {
['sandwich'] = {
ItemLabel = "Sandwich",
Defaultamount = 50,
BPrice = 200,
MaxAmount = 50,
SPrice = 150,
},
['cola'] = {
label = "Cola",
Defaultamount = 50,
BPrice = 50,
MaxAmount = 50,
SPrice = 10,
},
}
},
}
Built to update and extend shops system created by: K5
Last updated