This error is not from me, can you look at the item names in the config, I tested it on my friend and if we saw something like this, we would fix it.
0
2y ago#27
esplugin, post: 286971, member: 56309 SCRIPT ERROR: @ac-shop/server/server.lua:97: attempt to call a nil value (field 'addInventoryItem')
What is your inventory and in which infrastructure are you getting errors?
0
2y ago#28
New QBCore lj-inventory bro :=)
WestRust, post: 286994, member: 29287 What is your inventory and in which infrastructure are you getting errors?
0
2y ago#29
It will be fixed if you change it with the lj inventory item giving event, or it may not be the required parameter, so can you make the necessary change by looking in another script?
0
2y ago#30
WestRust, post: 287002, member: 29287 It will be fixed if you change it with the lj inventory item giving event, or it may not be the required parameter, so can you make the necessary change by looking in another script?
Yes ı fixed qbcore
local QBCore = exports['qb-core']:GetCoreObject() RegisterNetEvent('ac-shop:pay') AddEventHandler('ac-shop:pay', function(data) local src = source local xPlayer = QBCore.Functions.GetPlayer(src) if data.payType == "cash" then local money = xPlayer.PlayerData.money['cash'] if money >= data.price then xPlayer.Functions.RemoveMoney('cash', data.price, "Shops") AC.Success() for k,v in pairs(data.cartArr) do xPlayer.Functions.AddItem(v.itemname, tonumber(v.count)) end else AC.Error() end else local bankMoney = xPlayer.PlayerData.money['bank'] if bankMoney >= data.price then xPlayer.Functions.RemoveMoney('bank', data.price, "Shops") AC.Success() for k,v in pairs(data.cartArr) do xPlayer.Functions.AddItem(v.itemname, tonumber(v.count)) end else AC.Error() end end end)
local QBCore = exports['qb-core']:GetCoreObject() RegisterNetEvent('ac-shop:pay') AddEventHandler('ac-shop:pay', function(data) local src = source local xPlayer = QBCore.Functions.GetPlayer(src) if data.payType == "cash" then local money = xPlayer.PlayerData.money['cash'] if money >= data.price then xPlayer.Functions.RemoveMoney('cash', data.price, "Shops") AC.Success() for k,v in pairs(data.cartArr) do xPlayer.Functions.AddItem(v.itemname, tonumber(v.count)) end else AC.Error() end else local bankMoney = xPlayer.PlayerData.money['bank'] if bankMoney >= data.price then xPlayer.Functions.RemoveMoney('bank', data.price, "Shops") AC.Success() for k,v in pairs(data.cartArr) do xPlayer.Functions.AddItem(v.itemname, tonumber(v.count)) end else AC.Error() end end end)
Thanks for sharing. If anyone else gets the same error, they can use this.
0
2y ago#32
[ATTACH type="full" width="674px"]13055[/ATTACH]
working but if i buy it doesn't send to my inventory
working but i get the bug an item name at shoping chart, and if i buy it doesn't send to my inventory
Use the item giving function suitable for your inventory, whatever infrastructure you are using, make that code by looking at the item giving function in your script.
0
2y ago#34
WestRust, post: 286887, member: 29287 I added the new link, do not forget to select the discount from the new link and the framework from the config.
i have test it and it works thank you very much but i have pay double can you give me credits back please
0
2y ago#35
Good share bro cheers good one this
0
2y ago#36
esx or qb open source +rep
0
2y ago#37
Nice thanks man for this share
0
2y ago#38
WestRust, post: 287335, member: 29287 esx or qb open source +rep
can you give me please my credits back i have pay double that would be nice
95 replies
If you tell me what doesn't work, I will fix it, but it works for everyone now.
Add the items you want to the markets from the config and as an extra example, you can look at markets numbered 12 and 13, they also have items.
please tell
[ATTACH type="full"]12902[/ATTACH]
the all name i knife
This error is not from me, can you look at the item names in the config, I tested it on my friend and if we saw something like this, we would fix it.
What is your inventory and in which infrastructure are you getting errors?
Yes ı fixed qbcore
local QBCore = exports['qb-core']:GetCoreObject()
RegisterNetEvent('ac-shop:pay')
AddEventHandler('ac-shop:pay', function(data)
local src = source
local xPlayer = QBCore.Functions.GetPlayer(src)
if data.payType == "cash" then
local money = xPlayer.PlayerData.money['cash']
if money >= data.price then
xPlayer.Functions.RemoveMoney('cash', data.price, "Shops")
AC.Success()
for k,v in pairs(data.cartArr) do
xPlayer.Functions.AddItem(v.itemname, tonumber(v.count))
end
else
AC.Error()
end
else
local bankMoney = xPlayer.PlayerData.money['bank']
if bankMoney >= data.price then
xPlayer.Functions.RemoveMoney('bank', data.price, "Shops")
AC.Success()
for k,v in pairs(data.cartArr) do
xPlayer.Functions.AddItem(v.itemname, tonumber(v.count))
end
else
AC.Error()
end
end
end)
Thanks for sharing. If anyone else gets the same error, they can use this.
working but if i buy it doesn't send to my inventory
Use the item giving function suitable for your inventory, whatever infrastructure you are using, make that code by looking at the item giving function in your script.
i have test it and it works thank you very much but i have pay double can you give me credits back please
can you give me please my credits back i have pay double that would be nice
CAN YOU HELP ME mm