big update. i prob broke something, let me know in discord

This commit is contained in:
Mustache Dom authored and GitHub committed 2024-09-24 15:07:41 -07:00
1 parent 009b0a4f4a
commit 028c5f771f
42 files changed
+2042 -3056

No files matched your search

+7 -5
View File
@@ -1,13 +1,15 @@
local QBCore = exports['qb-core']:GetCoreObject()
local loc = math.random(1, #Config.Travellingmerchant)
RegisterServerEvent("md-drugs:server:travellingmerchantox", function(amount, money, item, price,table,num)
local src = source local Player = QBCore.Functions.GetPlayer(src)
if not table[num]['name'] == item then return end
if Player.Functions.RemoveMoney(tostring(money), tonumber(price) * tonumber(amount)) then
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], "add", amount)
Player.Functions.AddItem(item, amount)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bought ' .. amount .. ' Of ' .. item .. ' For ' .. tonumber(price) * tonumber(amount) .. '!', 'merchant')
AddItem(source, item, amount)
Log(GetName(source) .. ' Bought ' .. amount .. ' Of ' .. item .. ' For ' .. tonumber(price) * tonumber(amount) .. '!', 'merchant')
end
end)
lib.callback.register('md-drugs:server:GetMerchant', function(source)
return loc
end)