mirror of
https://github.com/jimathy/jim-payments.git
synced 2026-08-21 16:22:49 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec40bd5cf1 | ||
|
|
70f2ed8005 | ||
|
|
f0f5f19af8 | ||
|
|
939026fd68 |
@@ -81,9 +81,21 @@ TriggerEvent('jim-payments:Tickets:Give', { sender = Ply.PlayerData.charinfo.fir
|
|||||||
```
|
```
|
||||||
- The phone should now be integrated with jim-payments
|
- The phone should now be integrated with jim-payments
|
||||||
|
|
||||||
---
|
#### Renewed QB-Phone:
|
||||||
|
- Go to `qb-phone > server > invoices.lua`
|
||||||
|
- Search for the event: `qb-phone:server:PayMyInvoice` and search for this line:
|
||||||
|
```lua
|
||||||
|
TriggerEvent("qb-phone:server:InvoiceHandler", true, amount, src, resource)
|
||||||
|
```
|
||||||
|
|
||||||
|
- Directly under this line add this event:
|
||||||
|
```lua
|
||||||
|
TriggerEvent('jim-payments:Tickets:Give', { amount = amount, senderCitizenId = sendercitizenid, sender = SenderPly.PlayerData.charinfo.firstname, society = society }, SenderPly)
|
||||||
|
```
|
||||||
|
- When invoices are paid, they should now be integrated with jim-payments
|
||||||
|
|
||||||
# Setup/Config
|
# Setup/Config
|
||||||
---
|
|
||||||
## Custom Locations
|
## Custom Locations
|
||||||
|
|
||||||
- You can make of this payment system for a job script that wasn't created by me
|
- You can make of this payment system for a job script that wasn't created by me
|
||||||
@@ -180,6 +192,9 @@ FineJobList = true, -- "true" to use nearby player list feature in the cash regi
|
|||||||
- Support for renewed banking added
|
- Support for renewed banking added
|
||||||
- Toggle `RenewedBanking` in the config.lua to enable this
|
- Toggle `RenewedBanking` in the config.lua to enable this
|
||||||
|
|
||||||
|
### Renewed's qb-phone
|
||||||
|
- Simply leave the Config.PhoneType as `"qb"`
|
||||||
|
|
||||||
### AP-Goverment
|
### AP-Goverment
|
||||||
- Support for AP-Goverment Tax on payments
|
- Support for AP-Goverment Tax on payments
|
||||||
- Toggle `ApGov` in the config.lua to enable this
|
- Toggle `ApGov` in the config.lua to enable this
|
||||||
+5
-4
@@ -1,4 +1,4 @@
|
|||||||
print("^2Jim^7-^2Payments ^7v^42^7.^48^7.^41 ^7- ^2Payments Script by ^1Jimathy^7")
|
print("^2Jim^7-^2Payments ^7v^42^7.^48^7.^43 ^7- ^2Payments Script by ^1Jimathy^7")
|
||||||
|
|
||||||
-- If you need support I now have a discord available, it helps me keep track of issues and give better support.
|
-- If you need support I now have a discord available, it helps me keep track of issues and give better support.
|
||||||
|
|
||||||
@@ -15,6 +15,9 @@ Config = {
|
|||||||
Manage = true, -- "true" if using qb-management
|
Manage = true, -- "true" if using qb-management
|
||||||
-- "false" if using qb-bossmenu
|
-- "false" if using qb-bossmenu
|
||||||
|
|
||||||
|
RenewedBanking = false, -- Enable if using Renewed-Banking (requires Manage to be true and leaving jim-payments banking part separate)
|
||||||
|
ApGov = false, -- Toggle support for AP-Goverment Tax
|
||||||
|
|
||||||
List = true, -- "true" to use nearby player list feature in the cash registers, "false" for manual id entry
|
List = true, -- "true" to use nearby player list feature in the cash registers, "false" for manual id entry
|
||||||
PaymentRadius = 15, -- This is how far the playerlist will check for nearby players (based on the person charging)
|
PaymentRadius = 15, -- This is how far the playerlist will check for nearby players (based on the person charging)
|
||||||
|
|
||||||
@@ -36,7 +39,7 @@ Config = {
|
|||||||
`U_F_M_CasinoShop_01`,
|
`U_F_M_CasinoShop_01`,
|
||||||
},
|
},
|
||||||
|
|
||||||
PhoneBank = false, -- Set this to false to use the popup payment system FOR CARD/BANK PAYMENTS instead of using phone invoices
|
PhoneBank = false, -- 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 doesn't affect Cash payments as they by default use confirmation now
|
||||||
-- This is helpful for phones that don't support invoices well
|
-- This is helpful for phones that don't support invoices well
|
||||||
|
|
||||||
@@ -89,8 +92,6 @@ Config = {
|
|||||||
FineJobConfirmation = false, --"true" makes it so fines need confirmation, "false" skips this ands just removes the money
|
FineJobConfirmation = false, --"true" makes it so fines need confirmation, "false" skips this ands just removes the money
|
||||||
FineJobList = true, -- "true" to use nearby player list feature in the cash registers, "false" for manual id entry
|
FineJobList = true, -- "true" to use nearby player list feature in the cash registers, "false" for manual id entry
|
||||||
|
|
||||||
RenewedBanking = false, -- Enable if using renewed banking
|
|
||||||
ApGov = false, -- Add support for AP-Goverment Tax
|
|
||||||
---------------------
|
---------------------
|
||||||
-- Banking Systems --
|
-- Banking Systems --
|
||||||
---------------------
|
---------------------
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
name "Jim-Payments"
|
name "Jim-Payments"
|
||||||
author "Jimathy"
|
author "Jimathy"
|
||||||
version "v2.8.1"
|
version "v2.8.3"
|
||||||
description "Payment Script By Jimathy"
|
description "Payment Script By Jimathy"
|
||||||
fx_version "cerulean"
|
fx_version "cerulean"
|
||||||
game "gta5"
|
game "gta5"
|
||||||
@@ -9,4 +9,4 @@ lua54 'yes'
|
|||||||
dependencies { 'qb-input', 'qb-target', }
|
dependencies { 'qb-input', 'qb-target', }
|
||||||
client_scripts { 'client/*.lua', 'locales/*.lua' }
|
client_scripts { 'client/*.lua', 'locales/*.lua' }
|
||||||
server_scripts { '@oxmysql/lib/MySQL.lua', 'server/*.lua' }
|
server_scripts { '@oxmysql/lib/MySQL.lua', 'server/*.lua' }
|
||||||
shared_scripts { 'config.lua', 'shared/*.lua', 'locales/*.lua' }
|
shared_scripts { 'config.lua', 'shared/*.lua', 'locales/*.lua' }
|
||||||
+16
-15
@@ -24,18 +24,18 @@ RegisterServerEvent('jim-payments:Tickets:Give', function(data, biller, gang)
|
|||||||
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
|
if Config.Manage then
|
||||||
if RenewedBanking then exports['Renewed-Banking']:addAccountMoney(tostring(biller.PlayerData.gang.name), data.amount - takecomm)
|
if Config.RenewedBanking then exports['Renewed-Banking']:addAccountMoney(tostring(biller.PlayerData.gang.name), data.amount - takecomm)
|
||||||
if Config.Debug then print("^5Debug^7: ^3QB^7-^3Management^7(^3Gang^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.gang.name).."^7' ($^6"..exports['Renewed-Banking']:getAccountMoney(biller.PlayerData.gang.name).."^7)") end
|
if Config.Debug then print("^5Debug^7: ^3Renewed-Banking^7(^3Gang^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.gang.name).."^7' ($^6"..exports['Renewed-Banking']:getAccountMoney(biller.PlayerData.gang.name).."^7)") end
|
||||||
else
|
else
|
||||||
exports["qb-management"]:AddGangMoney(tostring(biller.PlayerData.gang.name), data.amount - takecomm)
|
exports["qb-management"]:AddGangMoney(tostring(biller.PlayerData.gang.name), data.amount - takecomm)
|
||||||
if Config.Debug then print("^5Debug^7: ^3Renewed-Banking^7(^3Gang^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.gang.name).."^7' ($^6"..exports["qb-management"]:GetGangAccount(biller.PlayerData.gang.name).."^7)") end
|
if Config.Debug then print("^5Debug^7: ^3QB-Management^7(^3Gang^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.gang.name).."^7' ($^6"..exports["qb-management"]:GetGangAccount(biller.PlayerData.gang.name).."^7)") end
|
||||||
end
|
end
|
||||||
else TriggerEvent("qb-gangmenu:server:addAccountMoney", tostring(biller.PlayerData.gang.name), data.amount - takecomm)
|
else TriggerEvent("qb-gangmenu:server:addAccountMoney", tostring(biller.PlayerData.gang.name), data.amount - takecomm)
|
||||||
if Config.Debug then print("^5Debug^7: ^3QB^7-^3GangMenu^7: ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.gang.name).."^7'") end
|
if Config.Debug then print("^5Debug^7: ^3QB^7-^3GangMenu^7: ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.gang.name).."^7'") end
|
||||||
end
|
end
|
||||||
elseif not gang then
|
elseif not gang then
|
||||||
if Config.Manage then
|
if Config.Manage then
|
||||||
if RenewedBanking then exports['Renewed-Banking']:addAccountMoney(tostring(biller.PlayerData.job.name), data.amount - takecomm)
|
if Config.RenewedBanking then exports['Renewed-Banking']:addAccountMoney(tostring(biller.PlayerData.job.name), data.amount - takecomm)
|
||||||
if Config.Debug then print("^5Debug^7: ^3Renewed-Banking^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports['Renewed-Banking']:getAccountMoney(biller.PlayerData.job.name).."^7)") end
|
if Config.Debug then print("^5Debug^7: ^3Renewed-Banking^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports['Renewed-Banking']:getAccountMoney(biller.PlayerData.job.name).."^7)") end
|
||||||
else
|
else
|
||||||
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - takecomm)
|
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - takecomm)
|
||||||
@@ -54,7 +54,7 @@ RegisterServerEvent('jim-payments:Tickets:Give', function(data, biller, gang)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local duty = true
|
local duty = true
|
||||||
if not biller.PlayerData.job.onduty or gang == nil then duty = false end
|
if not biller.PlayerData.job.onduty or gang ~= nil then duty = false end
|
||||||
|
|
||||||
-- If ticket system enabled, do this
|
-- If ticket system enabled, do this
|
||||||
if duty and Config.TicketSystem then
|
if duty and Config.TicketSystem then
|
||||||
@@ -64,21 +64,18 @@ RegisterServerEvent('jim-payments:Tickets:Give', function(data, biller, gang)
|
|||||||
local Player = QBCore.Functions.GetPlayer(v)
|
local Player = QBCore.Functions.GetPlayer(v)
|
||||||
if Player ~= nil or Player ~= billed 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})
|
if Player.Functions.AddItem('payticket', 1) then TriggerClientEvent('inventory:client:ItemBox', Player.PlayerData.source, QBCore.Shared.Items['payticket'], "add", 1) end
|
||||||
triggerNotify(nil, Loc[Config.Lan].success["rec_rec"], 'success', Player.PlayerData.source)
|
triggerNotify(nil, Loc[Config.Lan].success["rec_rec"], 'success', Player.PlayerData.source)
|
||||||
TriggerClientEvent('inventory:client:ItemBox', Player.PlayerData.source, QBCore.Shared.Items['payticket'], "add", 1)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if gang then
|
if gang then
|
||||||
biller.Functions.AddItem('payticket', 1, false, {["quality"] = nil})
|
if biller.Functions.AddItem('payticket', 1) then TriggerClientEvent('inventory:client:ItemBox', biller.PlayerData.source, QBCore.Shared.Items['payticket'], "add", 1) end
|
||||||
triggerNotify(nil, Loc[Config.Lan].success["rec_rec"], 'success', biller.PlayerData.source)
|
triggerNotify(nil, Loc[Config.Lan].success["rec_rec"], 'success', biller.PlayerData.source)
|
||||||
TriggerClientEvent('inventory:client:ItemBox', biller.PlayerData.source, QBCore.Shared.Items['payticket'], "add", 1)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
biller.Functions.AddItem('payticket', 1, false, {["quality"] = nil})
|
if biller.Functions.AddItem('payticket', 1) then TriggerClientEvent('inventory:client:ItemBox', biller.PlayerData.source, QBCore.Shared.Items['payticket'], "add", 1) end
|
||||||
triggerNotify(nil, Loc[Config.Lan].success["rec_rec"], 'success', biller.PlayerData.source)
|
triggerNotify(nil, Loc[Config.Lan].success["rec_rec"], 'success', biller.PlayerData.source)
|
||||||
TriggerClientEvent('inventory:client:ItemBox', biller.PlayerData.source, QBCore.Shared.Items['payticket'], "add", 1)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -143,7 +140,11 @@ RegisterServerEvent("jim-payments:server:Charge", function(citizen, price, billt
|
|||||||
if Config.PhoneType == "qb" then
|
if Config.PhoneType == "qb" then
|
||||||
MySQL.Async.insert(
|
MySQL.Async.insert(
|
||||||
'INSERT INTO phone_invoices (citizenid, amount, society, sender, sendercitizenid) VALUES (?, ?, ?, ?, ?)',
|
'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})
|
{billed.PlayerData.citizenid, amount, biller.PlayerData.job.name, biller.PlayerData.charinfo.firstname, biller.PlayerData.citizenid}, function(id)
|
||||||
|
if id then
|
||||||
|
TriggerClientEvent('qb-phone:client:AcceptorDenyInvoice', billed.PlayerData.source, id, biller.PlayerData.charinfo.firstname, biller.PlayerData.job.name, biller.PlayerData.citizenid, amount, GetInvokingResource())
|
||||||
|
end
|
||||||
|
end)
|
||||||
TriggerClientEvent('qb-phone:RefreshPhone', billed.PlayerData.source)
|
TriggerClientEvent('qb-phone:RefreshPhone', billed.PlayerData.source)
|
||||||
elseif Config.PhoneType == "gks" then
|
elseif Config.PhoneType == "gks" then
|
||||||
MySQL.Async.execute('INSERT INTO gksphone_invoices (citizenid, amount, society, sender, sendercitizenid, label) VALUES (@citizenid, @amount, @society, @sender, @sendercitizenid, @label)', {
|
MySQL.Async.execute('INSERT INTO gksphone_invoices (citizenid, amount, society, sender, sendercitizenid, label) VALUES (@citizenid, @amount, @society, @sender, @sendercitizenid, @label)', {
|
||||||
@@ -192,7 +193,7 @@ RegisterServerEvent("jim-payments:server:PolCharge", function(citizen, price)
|
|||||||
if Config.ApGov then exports['ap-government']:chargeCityTax(billed.PlayerData.source, "Item", price) end
|
if Config.ApGov then exports['ap-government']:chargeCityTax(billed.PlayerData.source, "Item", price) end
|
||||||
if biller.Functions.AddMoney("bank", commission) then if Config.Debug then print("^5Debug^7: ^3PolCharge^7 - ^2Commission of ^7$^6"..commission.." ^2sent to Player^7(^6"..biller.PlayerData.source.."^7)") end end
|
if biller.Functions.AddMoney("bank", commission) then if Config.Debug then print("^5Debug^7: ^3PolCharge^7 - ^2Commission of ^7$^6"..commission.." ^2sent to Player^7(^6"..biller.PlayerData.source.."^7)") end end
|
||||||
if Config.Manage then
|
if Config.Manage then
|
||||||
if RenewedBanking then exports['Renewed-Banking']:addAccountMoney(tostring(biller.PlayerData.job.name), (price - commission))
|
if Config.RenewedBanking then exports['Renewed-Banking']:addAccountMoney(tostring(biller.PlayerData.job.name), (price - commission))
|
||||||
if Config.Debug then print("^5Debug^7: ^3Renewed-Banking^7(^3Job^7): ^2Adding ^7$^6"..(price - commission).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports['Renewed-Banking']:getAccountMoney((biller.PlayerData.job.name).."^7)")) end
|
if Config.Debug then print("^5Debug^7: ^3Renewed-Banking^7(^3Job^7): ^2Adding ^7$^6"..(price - commission).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports['Renewed-Banking']:getAccountMoney((biller.PlayerData.job.name).."^7)")) end
|
||||||
else
|
else
|
||||||
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), (price - commission))
|
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), (price - commission))
|
||||||
@@ -221,7 +222,7 @@ RegisterServerEvent("jim-payments:server:PolPopup", function(data)
|
|||||||
triggerNotify(nil, billed.PlayerData.charinfo.firstname..Loc[Config.Lan].success["accepted_pay"]..data.amount..Loc[Config.Lan].success["charge_end"], "success", data.biller)
|
triggerNotify(nil, billed.PlayerData.charinfo.firstname..Loc[Config.Lan].success["accepted_pay"]..data.amount..Loc[Config.Lan].success["charge_end"], "success", data.biller)
|
||||||
if biller.Functions.AddMoney("bank", commission) then if Config.Debug then print("^5Debug^7: ^3PolCharge^7 - ^2Commission^2 of ^7$^6"..commission.." ^2sent to Player^7(^6"..biller.PlayerData.source.."^7)") end end
|
if biller.Functions.AddMoney("bank", commission) then if Config.Debug then print("^5Debug^7: ^3PolCharge^7 - ^2Commission^2 of ^7$^6"..commission.." ^2sent to Player^7(^6"..biller.PlayerData.source.."^7)") end end
|
||||||
if Config.Manage then
|
if Config.Manage then
|
||||||
if RenewedBanking then exports['Renewed-Banking']:addAccountMoney(tostring(biller.PlayerData.job.name), data.amount - commission)
|
if Config.RenewedBanking then exports['Renewed-Banking']:addAccountMoney(tostring(biller.PlayerData.job.name), data.amount - commission)
|
||||||
if Config.Debug then print("^5Debug^7: ^3Renewed-Banking^7(^3Job^7): ^2Adding ^7$^6"..(data.amount - commission).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports['Renewed-Banking']:getAccountMoney((biller.PlayerData.job.name).."^7)")) end
|
if Config.Debug then print("^5Debug^7: ^3Renewed-Banking^7(^3Job^7): ^2Adding ^7$^6"..(data.amount - commission).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports['Renewed-Banking']:getAccountMoney((biller.PlayerData.job.name).."^7)")) end
|
||||||
else
|
else
|
||||||
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - commission)
|
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - commission)
|
||||||
@@ -243,4 +244,4 @@ QBCore.Functions.CreateCallback('jim-payments:MakePlayerList', function(source,
|
|||||||
onlineList[#onlineList+1] = { value = tonumber(v), text = "["..v.."] - "..P.PlayerData.charinfo.firstname..' '..P.PlayerData.charinfo.lastname }
|
onlineList[#onlineList+1] = { value = tonumber(v), text = "["..v.."] - "..P.PlayerData.charinfo.firstname..' '..P.PlayerData.charinfo.lastname }
|
||||||
end
|
end
|
||||||
cb(onlineList)
|
cb(onlineList)
|
||||||
end)
|
end)
|
||||||
Reference in New Issue
Block a user