• We have a new discord! click here to join
    Any faulty links ? Report them in our discord or via our Ticket System!
    We do everything we can to protect the safety of our visitors, if any resource contains malware in any kind of form or obfuscation please report it aswell ♡♡

STANDALONE Ac-Shop (4 Viewers)

WestRust

Well-known member
Aug 26, 2022
274
32
28
Credits
2,276
@YehodAtias

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.
 

WestRust

Well-known member
Aug 26, 2022
274
32
28
Credits
2,276
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?
 

esplugin

Member
Aug 2, 2023
42
34
18
Germany
Credits
365
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)
 

WestRust

Well-known member
Aug 26, 2022
274
32
28
Credits
2,276
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.
 
  • Post hidden due to user being banned.

Users who are viewing this thread

Top