[DISCONTINUED] esx-kr-advanced-shops

How to solve it, only one person can use the store at the same time

@KRILLE This is also a dupe method if a player puts 100 of an item for $1 and 2 players both click to buy all 100 at the same time, it makes 200.

Super simple fix below
in server\main.lua

Replace this code:

			if ItemCount <= 0 then
                TriggerClientEvent('esx:showNotification', src, '~r~invalid quantity.')

With this code:

		local InventoryCheck = result[1].count - ItemCount
			if ItemCount <= 0 or InventoryCheck <= -1 then
                TriggerClientEvent('esx:showNotification', src, '~r~invalid quantity.')
1 Like

Any idea how to make new shops?
I added a new shop in the config.lua with robbery and in DB with a new id added the coords and everything in client main.lua. now am getting errors in the script and can’t start. any help?

Easy peasy. As example we add shop 22:

  1. Go to config.lua and add a new store and a new robbery:
  Shop22 = {
    Pos = {x = -161.91,  y = -1344.83, z = 29.01, number = 21}
  },
  Robbery22= {
    Pos   = {x = -160.72,  y = -1355.57, z = 30.01, number = 122, red = true},
  },
  1. client/main.lua line 776 add:

[22] = {x = -161.91, y = -1344.83, z = 30.01, n = 22},

  1. client/main.lua line 833 add:

[22] = {x = -160.72, y = -1355.7, z = 30.01, heading = 247.6},

  1. go to your database and add: (were 22 is the shopnumber)
INSERT INTO `owned_shops` (`identifier`, `ShopNumber`, `money`, `ShopValue`, `LastRobbery`, `ShopName`) VALUES
  ('0', 22, 0, 1500000, 1549643682, '0');
  1. restart your server.

That’s it

I try to add the item limit to the cart, but i don’t get it working.

I think i have script.js correctly. Does anyone knows what i need to add into server/main.lua?

Thanks. will give it a go.

It worked. Thanks a ton <3

1 Like

So am trying to add new icons

files({
  'html/index.html',
  'html/script.js',
  'html/style.css',
	'html/img/burger.png',
	'html/img/bottle.png',
     'html/font/vibes.ttf',
  'html/img/box.png',
	'html/img/carticon.png',
		'html/img/ammo.png',
	'html/img/beer.png',
	'html/img/blowt.png',
	'html/img/gym.png',
	'html/img/phone.png',
	'html/img/repair.png',
	'html/img/shaker.png',
	'html/img/vodka.png',
	'html/img/whisky.png',
})
Config.Items = {
    [1] = {label = "Water",       item = "water",        price = 5},
    [2] = {label = "Bread",      item = "bread",       price = 5},
	[3] = {label = "Beer",      item = "beer",       price = 10},
	[4] = {label = "Repair Kit",      item = "fixkit",       price = 1000},
	[5] = {label = "Gym Membership",      item = "gym_membership",       price = 100},
	[6] = {label = "Phone",      item = "phone",       price = 250},
	[7] = {label = "whiskey",      item = "whiskey",       price = 20},
	[8] = {label = "Vodka",      item = "vodka",       price = 25},
	[9] = {label = "Weapon Clip",      item = "clip",       price = 200},
	[10] = {label = "Bank Rasperry",      item = "rasperry",       price = 1250},
	[11] = {label = "Blow Torch ",      item = "blowtorch",       price = 500},
	[12] = {label = "Protein Shake ",      item = "protein_shake",       price = 30},
}

Config.Images = {
  [1] = {item = "water",   src = "img/bottle.png"},
  [2] = {item = "bread",   src = "img/burger.png"},
  [3] = {item = "beer",   src = "img/beer.png"},
  [4] = {item = "fixkit",   src = "img/repair.png"},
  [5] = {item = "gym_membership",   src = "img/gym.png"},
  [6] = {item = "phone",   src = "img/phone.png"},
  [7] = {item = "whiskey",   src = "img/whiskey.png"},
  [8] = {item = "vodka",   src = "img/vodka.png"},
  [9] = {item = "clip",   src = "img/ammo.png"},
  [11] = {item = "blowtorch",   src = "img/blowt.png"},
  [12] = {item = "protein_shake",   src = "img/shaker.png"},

and then I’ve those images same name same format in the httml/img 200x200.

Yet, they appear as boxes inside the shop.

what am I doing wrong here?

Boss actions are not opening up for me? what im doing wrong. When i click boss actions i dont get the UI i just get my cursor on the screen

1 Like

Yes, me too

[31m[ERROR] [MySQL] [esx-kr-advanced-shops] An error happens on MySQL for query “SELECT label, name, limit FROM items WHERE name = ‘wool’”: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘limit FROM items WHERE name = ‘wool’’ at line 1e[0m
SCRIPT ERROR: @esx-kr-advanced-shops/server/main.lua:100: attempt to index a nil value (upvalue ‘items’)

ref (@esx-kr-advanced-shops/server/main.lua:100)
(@mysql-async/mysql-async.js:14431)

How can we fix this? Players cannot store items in the shops

i fixed it by deleting all DB limit things

Awesome job and work, but I have a problem with robbery vault don’t show up…

Please can someone know how to fix this?

When i goto shop i cant open the menu when i press e ?? no errors in f8

How to fix this to prevent lag / delay on the server after more than 64 players.

FXServer Console saying 64 players after 20,000 ms.
The problem disappears once the shut down esx-kr-advanced-shops

Can you help me and say how to fix

image Why don’t stores have blips?


I installed it your way and couldn’t access the server

I cant get the items out of shipments. Time has expired, they show as ready shipments but cant select anything. Any ideas?

Anyone know how i fix the script so it allows me to put items out for sale instead of me putting them in my inventory first

did u manage to fix this please