diff --git a/server.lua b/server.lua index 70841c6..5e1f8aa 100644 --- a/server.lua +++ b/server.lua @@ -17,6 +17,7 @@ end) QBCore.Commands.Add("cashregister", "Use mobile cash register", {}, false, function(source) TriggerClientEvent("jim-payments:client:Charge", source, {}, true) end) RegisterServerEvent('jim-payments:Tickets:Give', function(data, biller, gang) + local billed = QBCore.Functions.GetPlayer(source) -- This should always be from the person who accepted the payment if biller then -- If this is found, it ISN'T a phone payment, so add money to society here if gang then if Config.Manage then exports["qb-management"]:AddGangMoney(tostring(biller.PlayerData.gang.name), data.amount) @@ -47,7 +48,7 @@ RegisterServerEvent('jim-payments:Tickets:Give', function(data, biller, gang) if data.amount >= Config.Jobs[data.society].MinAmountforTicket then for k, v in pairs(QBCore.Functions.GetPlayers()) do local Player = QBCore.Functions.GetPlayer(v) - if Player ~= nil then + if Player ~= nil or Player ~= billed then if Player.PlayerData.job.name == data.society and Player.PlayerData.job.onduty then Player.Functions.AddItem('payticket', 1, false, {["quality"] = nil}) TriggerClientEvent('QBCore:Notify', Player.PlayerData.source, 'Receipt received', 'success')