Theme editor

STANDALONE Ac-Shop

Thread owner
@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.
 
Thread owner
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?
 
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)
 
Thread owner
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.
Back
Top Bottom