Files
md-drugs/server/travellingmerchant.lua
T
Mustache Dom 3d144cae58 Added integration for Fivemerr
if you want to use the logs go to line 3 of server/functions.lua and turn to true, then inside of your server.cfg add this 

```
set fivemerrLogs "API_KEY"
```
obviously replace the API_KEY with your api key
2024-07-16 14:14:48 -07:00

13 lines
729 B
Lua

local QBCore = exports['qb-core']:GetCoreObject()
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')
end
end)