[ESX] [Supermarket]

Hello everybody, can someone help me with my issue ?

1 Like

hi zero were can i foud like you food and water hud ? tell my plz

Something pathetic, but can you please tell me how to change it so that the Dollar $ Sign is on the left of the item cost
? Rather than on the right.

Also my markers for some reason are flashing really quickly? Like glitching out fast
?

Make sure table shops on your database is not empty.

Go to esx_supermarket/html/scripts.js and change line 45 to

'<h4><b>' + '$' + item.label + '<div class="price">' + item.price + '</div>' + '</b></h4> ' +

About marker, you might have 2 resources running. Make sure the other script like esx_shops is not running.

2 Likes

Hi!

I would have a little problem with esx_supermarket, throw up this error message, any solution to it? (if necessary, I will submit that line of code). Unfortunately, I didn’t find out. Thanks in advance.

Error code: [script: esx_supermark] SCRIPT ERROR: @ esx_supermarket / server / main.lua: 43: attempt to index a zero value (’?’ Field)

I want to use esx_shop, or esx_supermarket, they both give me an unsolvable error (SCRIPT ERROR: @ esx_shops/server/main.lua:66: attempt to compare nil with number) when I try to buy something. I have already checked and imported the .sql file several times, but the error seems NOT to be the fault of the database. I hope someone can help me. Below I will send my script, thanks in advance!

My Script:
esx_supermarket.rar (447.7 KB)

You ever fix this ?

yes it’s good

somebody knowing what wrong when you can buy the item but not use them?

did it work?

did u have limit or weight in your items list?

if u have weight change this:

Line 60

if sourceItem.limit ~= -1 and (sourceItem.count + amount) > sourceItem.limit then

to this:

if sourceItem.weight ~= -1 and (sourceItem.count + amount) > sourceItem.weight then

If i wanted to add this to bt-target/qtarget, how would I do that?

Hey guys, first of all thanks for the nice script!
I wanted, that the Shop Blips on the Map have their own names and not just show “shops”.
I was not abled to find a copy paste solution but I figured out and thought I should share it with you guys.

In the config you just add a variable to any Pos of the shop, I called that variable “n” so it looks like this:

	xero24 = {
		Items = {},
		Pos = {
			{x = 373.875,   y = 325.896,  z = 102.566, n = "24Seven"},
			{x = 2557.458,  y = 382.282,  z = 107.622, n = "24Seven"},
			{x = -3038.939, y = 585.954,  z = 6.908, n = "24Seven"},
			{x = -3241.927, y = 1001.462, z = 11.830, n = "24Seven"},
			{x = 547.431,   y = 2671.710, z = 41.156, n = "24Seven"},
			{x = 1961.464,  y = 3740.672, z = 31.343, n = "24Seven"},
			{x = 2678.916,  y = 3280.671, z = 54.241, n = "24Seven"},
			{x = 1729.216,  y = 6414.131, z = 34.037, n = "24Seven"},
            		{x = 293.85, y = -1259.28, z = 29.45, n = "24Seven"},
			{x = -1094.46, y = -2595.25, z = 12.93, n = "24Seven"}, --Airport
			{x = 268.03, y = -979.63, z = 28.37, n = "24Seven"}--legionsquare
		}
	},

just add it to every shop you create and give it a name

Then you just need to change this part in the client main.lua:

-- Create Blips
Citizen.CreateThread(function()
	for k,v in pairs(Config.Zones) do
		for i = 1, #v.Pos, 1 do
			local blip = AddBlipForCoord(v.Pos[i].x, v.Pos[i].y, v.Pos[i].z)
			SetBlipSprite (blip, 52)
			SetBlipDisplay(blip, 4)
			SetBlipScale  (blip, 1.0)
			SetBlipColour (blip, 2)
			SetBlipAsShortRange(blip, true)
			BeginTextCommandSetBlipName("STRING")
			AddTextComponentString(_U('shops'))
			EndTextCommandSetBlipName(blip)
		end
	end
end)

to

-- Create Blips
Citizen.CreateThread(function()
	for k,v in pairs(Config.Zones) do
		for i = 1, #v.Pos, 1 do
			local blip = AddBlipForCoord(v.Pos[i].x, v.Pos[i].y, v.Pos[i].z)
			SetBlipSprite (blip, 52)
			SetBlipDisplay(blip, 4)
			SetBlipScale  (blip, 1.0)
			SetBlipColour (blip, 2)
			SetBlipAsShortRange(blip, true)
			BeginTextCommandSetBlipName("STRING")
			AddTextComponentString(v.Pos[i].n)
			EndTextCommandSetBlipName(blip)
		end
	end
end)

in my client main lua its line 83, just replace the AddTextComponentString(_U(‘shops’)) to AddTextComponentString(v.Pos[i].n)

of course you can do the same with the other blip values, like ID and color

Have a great one :v:

I try to buy something but it doesn’t give it to me
help

check your database in items if you use limit or weight, if you use weight, you need to change it in the server.lua where it checks the limit

i cant close or buy anythind pls help i cant find an good answer

Hello I’m having an error in a script

image

help please!!!

1 Like

getting the same script error as everyone else. The database is not empty and some of the items appear in the shops and I can buy them but only some and it’s random shops they’re not all the same. I don’t know a fix.

1 Like

Hi, i have problem, i cant start esx_supermarket


I drop it to [ESX] folder
add “start esx_supermarket”
Stop “#start esx_shops”
Run server, but supermarker doesnt work, and when i want it start manualy via F8 consolle it wrote “couldn’t find resource esx supermarket”
When i want start old esx_shops, its work without problem

Do you have any solution?
Thanx for everything