• Please report every thread you think might be harmful or does not meet expectations or the link is offline, you will be refunded the credits you paid and the Thread Starter recieves a message to update his content, if its malicious we remove it and warn and eventualy the TS if it reoccurs.

STANDALONE Ac-Shop (2 Viewers)

WestRust

Well-known member
Joined
Aug 26, 2022
Messages
252
Reaction score
17
Points
18
Credits
3,971
@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.
 

esplugin

Member
Joined
Aug 2, 2023
Messages
43
Reaction score
26
Points
18
Location
Germany
Credits
534
SCRIPT ERROR: @ac-shop/server/server.lua:97: attempt to call a nil value (field 'addInventoryItem')
 

WestRust

Well-known member
Joined
Aug 26, 2022
Messages
252
Reaction score
17
Points
18
Credits
3,971
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
Joined
Aug 2, 2023
Messages
43
Reaction score
26
Points
18
Location
Germany
Credits
534
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
Joined
Aug 26, 2022
Messages
252
Reaction score
17
Points
18
Credits
3,971
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.

jokerfleck

Active member
Joined
Apr 7, 2022
Messages
109
Reaction score
9
Points
18
Credits
55
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
 

Users who are viewing this thread

  • kelvintws
Top