fix bank popups and popup job tickets

This commit is contained in:
jimathy
2022-04-06 22:30:26 +01:00
committed by GitHub
parent a63b40c11f
commit 7e92b852cf
2 changed files with 4 additions and 7 deletions

View File

@@ -39,7 +39,7 @@ RegisterNetEvent('jim-payments:client:Charge', function(data)
local dialog = exports['qb-input']:ShowInput({ header = img..PlayerJob.label.." Cash Register", submitText = "Send", local dialog = exports['qb-input']:ShowInput({ header = img..PlayerJob.label.." Cash Register", submitText = "Send",
inputs = { inputs = {
{ text = " ", name = "citizen", type = "select", options = nearbyList }, { text = " ", name = "citizen", type = "select", options = nearbyList },
{ type = 'radio', name = 'billtype', text = 'Payment Type', options = { { value = "cash", text = "Cash" }, { value = "card", text = "Card" } } }, { type = 'radio', name = 'billtype', text = 'Payment Type', options = { { value = "cash", text = "Cash" }, { value = "bank", text = "Card" } } },
{ type = 'number', isRequired = true, name = 'price', text = '💵 Amount to Charge' },} { type = 'number', isRequired = true, name = 'price', text = '💵 Amount to Charge' },}
}) })
if dialog then if dialog then

View File

@@ -11,9 +11,6 @@ local function cv(amount)
return formatted return formatted
end end
AddEventHandler('onResourceStart', function(resource) if GetCurrentResourceName() == resource then
print(exports["qb-management"]:GetAccount("police")) end 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(amount, job) RegisterServerEvent('jim-payments:Tickets:Give', function(amount, job)
@@ -67,7 +64,7 @@ RegisterServerEvent("jim-payments:server:Charge", function(citizen, price, billt
TriggerClientEvent("QBCore:Notify", src, "Customer doesn't have enough cash to pay", "error") TriggerClientEvent("QBCore:Notify", src, "Customer doesn't have enough cash to pay", "error")
TriggerClientEvent("QBCore:Notify", tonumber(citizen), "You don't have enough cash to pay", "error") TriggerClientEvent("QBCore:Notify", tonumber(citizen), "You don't have enough cash to pay", "error")
end end
elseif billtype == "card" then elseif billtype == "bank" then
if Config.PhoneBank == false then if Config.PhoneBank == false then
TriggerClientEvent("jim-payments:client:PayPopup", billed.PlayerData.source, amount, src, billtype, img) TriggerClientEvent("jim-payments:client:PayPopup", billed.PlayerData.source, amount, src, billtype, img)
else else
@@ -90,7 +87,7 @@ RegisterServerEvent("jim-payments:server:PayPopup", function(data)
billed.Functions.RemoveMoney(tostring(data.billtype), data.amount) billed.Functions.RemoveMoney(tostring(data.billtype), data.amount)
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount) exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount)
--TriggerEvent("qb-bossmenu:server:addAccountMoney", tostring(biller.PlayerData.job.name), data.amount) --TriggerEvent("qb-bossmenu:server:addAccountMoney", tostring(biller.PlayerData.job.name), data.amount)
TriggerEvent('jim-payments:Tickets:Give', data.amount, tostring(billed.PlayerData.job.name)) TriggerEvent('jim-payments:Tickets:Give', data.amount, tostring(biller.PlayerData.job.name))
TriggerClientEvent("QBCore:Notify", data.biller, billed.PlayerData.charinfo.firstname.." accepted the payment", "success") TriggerClientEvent("QBCore:Notify", data.biller, billed.PlayerData.charinfo.firstname.." accepted the payment", "success")
elseif data.accept == false then elseif data.accept == false then
TriggerClientEvent("QBCore:Notify", src, "You declined the payment") TriggerClientEvent("QBCore:Notify", src, "You declined the payment")