mirror of
https://github.com/jimathy/jim-payments.git
synced 2026-08-19 15:26:03 +01:00
Stop giving the charged person tickets
This commit is contained in:
@@ -17,6 +17,7 @@ end)
|
|||||||
QBCore.Commands.Add("cashregister", "Use mobile cash register", {}, false, function(source) TriggerClientEvent("jim-payments:client:Charge", source, {}, true) 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)
|
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 biller then -- If this is found, it ISN'T a phone payment, so add money to society here
|
||||||
if gang then
|
if gang then
|
||||||
if Config.Manage then exports["qb-management"]:AddGangMoney(tostring(biller.PlayerData.gang.name), data.amount)
|
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
|
if data.amount >= Config.Jobs[data.society].MinAmountforTicket then
|
||||||
for k, v in pairs(QBCore.Functions.GetPlayers()) do
|
for k, v in pairs(QBCore.Functions.GetPlayers()) do
|
||||||
local Player = QBCore.Functions.GetPlayer(v)
|
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
|
if Player.PlayerData.job.name == data.society and Player.PlayerData.job.onduty then
|
||||||
Player.Functions.AddItem('payticket', 1, false, {["quality"] = nil})
|
Player.Functions.AddItem('payticket', 1, false, {["quality"] = nil})
|
||||||
TriggerClientEvent('QBCore:Notify', Player.PlayerData.source, 'Receipt received', 'success')
|
TriggerClientEvent('QBCore:Notify', Player.PlayerData.source, 'Receipt received', 'success')
|
||||||
|
|||||||
Reference in New Issue
Block a user