From 41c8e3698e49eb0f77df398d891a46b5d15b55f4 Mon Sep 17 00:00:00 2001 From: jimathy Date: Thu, 21 Apr 2022 19:53:48 +0100 Subject: [PATCH] Beta GKSPhone invoice support --- config.lua | 9 +++++++-- server.lua | 18 ++++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/config.lua b/config.lua index d84936f..e145b2d 100644 --- a/config.lua +++ b/config.lua @@ -34,7 +34,7 @@ Config.PedPool = { [14] = `U_F_M_CasinoShop_01`, } -Config.Gabz = false -- "true" to enable Gabz Banking locations +Config.Gabz = true -- "true" to enable Gabz Banking locations Config.useATM = true -- Enable this to use my ATM's Config.useBanks = true -- Enable this to use my banking stuff Config.BankBlips = true -- Enable this if you disabled qb-banking and need bank locations @@ -43,6 +43,10 @@ Config.ATMBlips = false -- Enable this if you are a pyscho and need every ATM to Config.PhoneBank = true -- Set this to false to use the popup payment system FOR CARD/BANK PAYMENTS instead of using phone invoices -- This doesn't affect Cash payments as they by default use confirmation now -- This is helpful for phones that don't support invoices well + +Config.PhoneType = "qb" -- Change this setting to make invoices work with your phone script [still testing this currently] + -- "qb" for qb-phone + -- "gks"" for GKSPhone Config.Commission = false -- Set this to true to enable Commissions and give the person charging a percentage of the total Config.CommissionAll = false -- Set this to true to give commission to workers clocked in @@ -179,6 +183,7 @@ Config.VanBankLocations = { vector4(247.08, 224.98, 106.29, 157.75), -- Pacific Bank Window 2 }, } + Config.GabzBankLocations = { ["legion"] = { vector4(149.5, -1042.08, 29.37, 342.74), -- Legion Fleeca @@ -210,4 +215,4 @@ Config.GabzBankLocations = { vector4(259.02, 214.32, 106.28, 337.82), -- Pacficic Gabz 9+10 vector4(254.27, 216.06, 106.28, 336.37), -- Pacficic Gabz 11+12 } -} +} \ No newline at end of file diff --git a/server.lua b/server.lua index edf93be..6568ea8 100644 --- a/server.lua +++ b/server.lua @@ -97,10 +97,20 @@ RegisterServerEvent("jim-payments:server:Charge", function(citizen, price, billt if Config.PhoneBank == false then TriggerClientEvent("jim-payments:client:PayPopup", billed.PlayerData.source, amount, src, billtype, img, biller.PlayerData.job.label) else - MySQL.Async.insert( - 'INSERT INTO phone_invoices (citizenid, amount, society, sender, sendercitizenid) VALUES (?, ?, ?, ?, ?)', - {billed.PlayerData.citizenid, amount, biller.PlayerData.job.name, biller.PlayerData.charinfo.firstname, biller.PlayerData.citizenid}) - TriggerClientEvent('qb-phone:RefreshPhone', billed.PlayerData.source) + if Config.PhoneType == "qb" then + MySQL.Async.insert( + 'INSERT INTO phone_invoices (citizenid, amount, society, sender, sendercitizenid) VALUES (?, ?, ?, ?, ?)', + {billed.PlayerData.citizenid, amount, biller.PlayerData.job.name, biller.PlayerData.charinfo.firstname, biller.PlayerData.citizenid}) + TriggerClientEvent('qb-phone:RefreshPhone', billed.PlayerData.source) + elseif Config.PhoneType == "gks" then + MySQL.Async.execute('INSERT INTO gksphone_invoices (citizenid, amount, society, sender, sendercitizenid) VALUES (@citizenid, @amount, @society, @sender, @sendercitizenid)', { + ['@citizenid'] = billed.PlayerData.citizenid, + ['@amount'] = amount, + ['@society'] = biller.PlayerData.job.name, + ['@sender'] = biller.PlayerData.charinfo.firstname, + ['@sendercitizenid'] = biller.PlayerData.citizenid + }) + end TriggerClientEvent('QBCore:Notify', src, 'Invoice Successfully Sent', 'success') TriggerClientEvent('QBCore:Notify', billed.PlayerData.source, 'New Invoice Received') end