(UPDATE-11/12/2019) [Release] [ESX] Shops with bars (V.1.7) (OLD ESX)

I got the sql error (1136): Column count doesn’t match value count at row 1. Whe trying to run the basicneeds sql

1 Like

Try this:

INSERT INTO `items` (`id`, `name`, `label`, `limit`, `rare`, `can_remove`) VALUES
('20', 'bread', 'Bread', -1, 0, 1),
('21', 'water', 'Water', -1, 0, 1),
('22', 'wine', 'Wine', -1, 0, 1),
('23', 'beer', 'Beer', -1, 0, 1),
('24', 'vodka', 'Vodka', -1, 0, 1),
('25', 'chocolate', 'Chocolate', -1, 0, 1),
('26', 'sandwich', 'Sandwich', -1, 0, 1),
('27', 'hamburger', 'Hamburger', -1, 0, 1),
('28', 'tequila', 'Tequila', -1, 0, 1),
('29', 'whisky', 'Whisky', -1, 0, 1),
('30', 'cupcake', 'Cupcake', -1, 0, 1),
('31', 'cocacola', 'Coca-Cola', -1, 0, 1),
('32', 'icetea', 'Ice-Tea', -1, 0, 1),
('33', 'redbull', 'Coffe', -1, 0, 1);

If that one doens’t work then try this:

INSERT INTO `items` (`id`, `name`, `label`, `items.limit`, `rare`, `can_remove`) VALUES
('20', 'bread', 'Bread', -1, 0, 1),
('21', 'water', 'Water', -1, 0, 1),
('22', 'wine', 'Wine', -1, 0, 1),
('23', 'beer', 'Beer', -1, 0, 1),
('24', 'vodka', 'Vodka', -1, 0, 1),
('25', 'chocolate', 'Chocolate', -1, 0, 1),
(26', 'sandwich', 'Sandwich', -1, 0, 1),
('27', 'hamburger', 'Hamburger', -1, 0, 1),
('28', 'tequila', 'Tequila', -1, 0, 1),
('29', 'whisky', 'Whisky', -1, 0, 1),
('30', 'cupcake', 'Cupcake', -1, 0, 1),
('31', 'cocacola', 'Coca-Cola', -1, 0, 1),
('32', 'icetea', 'Ice-Tea', -1, 0, 1),
('33', 'redbull', 'Coffe', -1, 0, 1);

Do I just paste and overwrite in the sql?
Now it gives error duplicate entry 20 for key PRIMARY

1 Like

You need to chagen the ids (numbers) for your table xD

Thanks. This is french to me. I have no idea how and where.
I’m learning as I go.

2 Likes

Go to your database, get into your items table and pm me a screenshot of what you seed inside
Or just try this:

INSERT INTO `items` (`id`, `name`, `label`, `items.limit`, `rare`, `can_remove`) VALUES
('NULL', 'bread', 'Bread', -1, 0, 1),
('NULL', 'water', 'Water', -1, 0, 1),
('NULL', 'wine', 'Wine', -1, 0, 1),
('NULL', 'beer', 'Beer', -1, 0, 1),
('NULL', 'vodka', 'Vodka', -1, 0, 1),
('NULL', 'chocolate', 'Chocolate', -1, 0, 1),
('NULL', 'sandwich', 'Sandwich', -1, 0, 1),
('NULL', 'hamburger', 'Hamburger', -1, 0, 1),
('NULL', 'tequila', 'Tequila', -1, 0, 1),
('NULL', 'whisky', 'Whisky', -1, 0, 1),
('NULL', 'cupcake', 'Cupcake', -1, 0, 1),
('NULL', 'cocacola', 'Coca-Cola', -1, 0, 1),
('NULL', 'icetea', 'Ice-Tea', -1, 0, 1),
('NULL', 'redbull', 'Coffe', -1, 0, 1);

does anyone know of a way to or if its even possible to change the quantity purchase in the shops… so like if i wanted to make it so someone could by a dozen of something they could do that in 1 purchase for a fixed price

2 Likes

@jcollins012


RegisterServerEvent('esx_shop:buyItem')
AddEventHandler('esx_shop:buyItem', function(itemName, price)

	local _source = source
	local xPlayer  = ESX.GetPlayerFromId(source)

	if xPlayer.get('money') >= price then
        if itemName == 'dozenofeggs' then
		    xPlayer.removeMoney(price)
		    xPlayer.addInventoryItem('egg', 12)

		    TriggerClientEvent('esx:showNotification', _source, _U('bought') .. ItemsLabels[itemName])
		else
		    xPlayer.removeMoney(price)
		    xPlayer.addInventoryItem(itemName, 1)

		    TriggerClientEvent('esx:showNotification', _source, _U('bought') .. ItemsLabels[itemName])
		end

	else
		TriggerClientEvent('esx:showNotification', _source, _U('not_enough'))
	end

end)

Add this in Database

INSERT INTO `shops` (name, item, price) VALUES
	('TwentyFourSeven','dozenofeggs',12),
        ('TwentyFourSeven','egg',1);
;

INSERT INTO `items` (`name`, `label`) VALUES
('dozenofeggs', '12xEggs')
('egg', 'Egg');
;
3 Likes

I cant get the menu to work. It pops up, but nothing shows up. Anything I can try?
(To clairfy what i mean by pops up but nothing shows up the header at the top shows up, but no options on what food/drinks or anything like that show up.

1 Like

Go into config.lua from esx_shops and delete tobbaco all 3 of them

Is that for me? (20char)

1 Like

Yes it is sir did you tried that? xD

not yet, i didnt know if it was for me or not. I will try that. Thanks.

I am getting this when i try importing the basicneeds sql file
image

1 Like
 INTO `items` (`id`, `name`, `label`, `limit`, `rare`, `can_remove`) VALUES
('NULL', 'bread', 'Bread', -1, 0, 1),
('NULL', 'water', 'Water', -1, 0, 1),
('NULL', 'wine', 'Wine', -1, 0, 1),
('NULL', 'beer', 'Beer', -1, 0, 1),
('NULL', 'vodka', 'Vodka', -1, 0, 1),
('NULL', 'chocolate', 'Chocolate', -1, 0, 1),
('NULL', 'sandwich', 'Sandwich', -1, 0, 1),
('NULL', 'hamburger', 'Hamburger', -1, 0, 1),
('NULL', 'tequila', 'Tequila', -1, 0, 1),
('NULL', 'whisky', 'Whisky', -1, 0, 1),
('NULL', 'cupcake', 'Cupcake', -1, 0, 1),
('NULL', 'cocacola', 'Coca-Cola', -1, 0, 1),
('NULL', 'icetea', 'Ice-Tea', -1, 0, 1),
('NULL', 'redbull', 'Coffe', -1, 0, 1);
1 Like

Now i get this when i replace that in the one already there.
image

1 Like

Send me screenshot of your items table by pm xD

You do NOT have to have an ID in there as it’s set to AUTO INCREMENT which means the database will do it for you. So this is what it should look like.

The whole sql file for basic needs should look like this (YES I fixed the Coffe to Coffee because it was makin’ me crazy, LOL):

INSERT INTO `items` (`name`, `label`, `limit`, `rare`, `can_remove`) VALUES
('bread', 'Bread', -1, 0, 1),
('water', 'Water', -1, 0, 1),
('wine', 'Wine', -1, 0, 1),
('beer', 'Beer', -1, 0, 1),
('vodka', 'Vodka', -1, 0, 1),
('chocolate', 'Chocolate', -1, 0, 1),
('sandwich', 'Sandwich', -1, 0, 1),
('hamburger', 'Hamburger', -1, 0, 1),
('tequila', 'Tequila', -1, 0, 1),
('whisky', 'Whisky', -1, 0, 1),
('cupcake', 'Cupcake', -1, 0, 1),
('cocacola', 'Coca-Cola', -1, 0, 1),
('icetea', 'Ice-Tea', -1, 0, 1),
('redbull', 'Coffee', -1, 0, 1);

Everything else that default sql file is trying to do is already set by es_extended which is why everyone is having a problem with the SQL.

Yes I’m new here but I hope to be of some help and not just another ugly face, LOL

P.S. I was a little mislead as well as I thought it would show the icons for each, for those that are wondering, IT DOES NOT show the icons. I wish it did though as that’s the main reason why I wanted this. In any case, make sure you try everything out on the menu to ensure the functionality of it all works. From my testing everything seems to be just fine.

2 Likes

Anyone know how to trigger them sober on death? If you die drunk your still drunk on respawn! lol Got it!

1 Like

[Release] Shops with bars (V.1.1)

What have i added or done you ask?
Nothing too serious just make some improvements and fixed some stuff

You can find the download of the new version on the post itself

  • Change Log:
    • Sql files fixed.
    • Config.lua of shops fixed.
    • Lighter and Cigarett added.
    • You can only use the cigarett if you have and lighter.

Hope you guys enjoy the new update
If you need help just contact me via discord

1 Like