Hello,
So i’ve created my own script based on esx_shops and i did some good work on it, well optimized script works with all ESX versions, i’ve been looking for a similar script but it seems there’s nothing except for esx_DarkShops as it is outdated and not working anymore, so i had to improvise and share with you guys my first release ever, hope you enjoy it.
Type “/tp -1220.952 -170.450 38.400” to go to the location
(you can change the location in “esx_darkstore/config.lua”)
sorry im still confused over the esx stuff, is the items sold here the limit kind or the weight kind. i guess it does not really matter. im using the old limit style of items. i should be able to plug in items I already have in my database right?
if you have weight instead of limit you just have to edit the “esx_darkstore.sql” go to:
CREATE TABLE `darkstore` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`store` varchar(100) NOT NULL,
`item` varchar(100) NOT NULL, --- change this from "item" to "weight"
`price` int(11) NOT NULL,
PRIMARY KEY (`id`)
);
also if you’re using item version, you probably don’t have to change anything in the SQL file, just import it into your database and you’re good to go.
if xPlayer.getAccount('black_money').money >= price then
-- can the player carry the said amount of x item?
if sourceItem.limit ~= -1 and (sourceItem.count + amount) > sourceItem.limit then
TriggerClientEvent('esx:showNotification', _source, _U('player_cannot_hold'))
else
xPlayer.removeAccountMoney('black_money', price)
xPlayer.addInventoryItem(itemName, amount)
TriggerClientEvent('esx:showNotification', _source, _U('bought', amount, itemLabel, price))
end
else
local missingMoney = price - xPlayer.getMoney('black')
TriggerClientEvent('esx:showNotification', _source, _U('not_enough_black', missingmoney))
end
end)
New
if sourceItem.limit ~= -1 and (sourceItem.count + amount) > sourceItem.limit then
TriggerClientEvent('esx:showNotification', _source, _U('player_cannot_hold'))
else
xPlayer.removeAccountMoney('cash', price)
xPlayer.addInventoryItem(itemName, amount)
TriggerClientEvent('esx:showNotification', _source, _U('bought', amount, itemLabel, price))
end
else
local missingMoney = price - xPlayer.getMoney()
TriggerClientEvent('esx:showNotification', _source, _U('not_enough', missingmoney))
end
end)
hi, thanks for the share. How can i add items to the darkstores? i add them in the database and in the config.lua in items [ ] but when i enter to the darkstore dont show any item