mirror of
https://github.com/jimathy/jim-payments.git
synced 2026-08-17 06:16:02 +01:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d55d809b64 | ||
|
|
5425082cb2 | ||
|
|
eb8a17c5c3 | ||
|
|
1236f549d9 | ||
|
|
bf476c9ca3 | ||
|
|
a90129b4c6 | ||
|
|
065ad75dbd | ||
|
|
763dd613a4 | ||
|
|
16515eceea | ||
|
|
c967159d2b | ||
|
|
7188e36881 | ||
|
|
34a1d0d504 | ||
|
|
92b55d9d2d | ||
|
|
d9dbbfa485 | ||
|
|
4ec75a90fa | ||
|
|
baca1add62 | ||
|
|
890d8d67b0 | ||
|
|
5a849f1028 | ||
|
|
42e3c7d2be | ||
|
|
28d80261a2 | ||
|
|
a61716db2d | ||
|
|
1c8942a107 | ||
|
|
bfc3a372d3 | ||
|
|
2aefb7fa3b | ||
|
|
1f109ee4c9 | ||
|
|
4f120d7276 | ||
|
|
71a6d4d7dd | ||
|
|
fc902b34e2 | ||
|
|
89fa06507b | ||
|
|
61e2e6f32e | ||
|
|
ec40bd5cf1 | ||
|
|
70f2ed8005 | ||
|
|
f0f5f19af8 | ||
|
|
939026fd68 |
31
README.md
31
README.md
@@ -5,6 +5,9 @@
|
||||
### If you need support I have a discord server available, it helps me keep track of issues and give better support.
|
||||
## https://discord.gg/xKgQZ6wZvS
|
||||
|
||||
### We also have Documentation over on Gitbook, feel free to check it out
|
||||
## https://jixelpatterns.gitbook.io/jixelpatterns-script-guide/overview/who-we-are
|
||||
|
||||
### If you think I did a good job here, consider donating as it keeps by lights on and my cat fat/floofy:
|
||||
## https://ko-fi.com/jixelpatterns
|
||||
|
||||
@@ -35,6 +38,15 @@ ensure [vehicles]
|
||||
ensure [jim]
|
||||
```
|
||||
|
||||
---
|
||||
## BZZ Terminal Instructions
|
||||
Free Package https://bzzz.tebex.io/package/5551076
|
||||
|
||||
Stream the prop and add the emote that is provided to rpemotes or dpemotes
|
||||
```lua
|
||||
['terminal'] = {['name'] = 'terminal', ['label'] = 'Wireless Terminal', ['weight'] = 5000, ["type"] = "item", ["image"] = 'terminal.png', ['unique'] = true, ['useable'] = true, ["shouldClose"] = true, ["combinable"] = nil, ['description'] = ''},
|
||||
```
|
||||
|
||||
---
|
||||
## Item installation
|
||||
- To make use of the ticket reward system for workers you need to add the ticket item to your shared items lua
|
||||
@@ -81,9 +93,21 @@ TriggerEvent('jim-payments:Tickets:Give', { sender = Ply.PlayerData.charinfo.fir
|
||||
```
|
||||
- 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
|
||||
---
|
||||
|
||||
## Custom Locations
|
||||
|
||||
- You can make of this payment system for a job script that wasn't created by me
|
||||
@@ -180,6 +204,9 @@ FineJobList = true, -- "true" to use nearby player list feature in the cash regi
|
||||
- Support for renewed banking added
|
||||
- Toggle `RenewedBanking` in the config.lua to enable this
|
||||
|
||||
### Renewed's qb-phone
|
||||
- Simply leave the Config.PhoneType as `"qb"`
|
||||
|
||||
### AP-Goverment
|
||||
- Support for AP-Goverment Tax on payments
|
||||
- Toggle `ApGov` in the config.lua to enable this
|
||||
@@ -1,6 +1,3 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
RegisterNetEvent('QBCore:Client:UpdateObject', function() QBCore = exports['qb-core']:GetCoreObject() end)
|
||||
|
||||
-- This script is a simple replacement for QB-Banking and QB-ATMs
|
||||
-- It uses QB-Input and server callbacks to retreive info about accounts and cash
|
||||
-- This requires QB-Target and has the location of every ATM, ATM prop and bank window
|
||||
@@ -108,7 +105,7 @@ RegisterNetEvent('jim-payments:Client:ATM:use', function(data)
|
||||
--this grabs all the info from names to savings account numbers in the databases
|
||||
local p = promise.new()
|
||||
QBCore.Functions.TriggerCallback('jim-payments:ATM:Find', function(cb) p:resolve(cb) end) local info = Citizen.Await(p)
|
||||
if not Config.Manage then
|
||||
if Config.Banking == "qb" then
|
||||
local p = promise.new()
|
||||
QBCore.Functions.TriggerCallback('qb-bossmenu:server:GetAccount', function(cb) p:resolve(cb) end, PlayerJob.name) info.society = Citizen.Await(p)
|
||||
local p2 = promise.new()
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
RegisterNetEvent('QBCore:Client:UpdateObject', function() QBCore = exports['qb-core']:GetCoreObject() end)
|
||||
|
||||
PlayerJob = {}
|
||||
PlayerGang = {}
|
||||
|
||||
@@ -61,6 +58,9 @@ RegisterNetEvent('jim-payments:client:Charge', function(data, outside)
|
||||
--Check if player is using /cashregister command
|
||||
if not outside and not onDuty and data.gang == nil then triggerNotify(nil, Loc[Config.Lan].error["not_onduty"], "error") return end
|
||||
local newinputs = {} -- Begin qb-input creation here.
|
||||
if Config.Usebzzz then
|
||||
TriggerEvent('animations:client:EmoteCommandStart', {'terminal'})
|
||||
end
|
||||
if Config.List then -- If nearby player list is wanted:
|
||||
--Retrieve a list of nearby players from server
|
||||
local p = promise.new() QBCore.Functions.TriggerCallback('jim-payments:MakePlayerList', function(cb) p:resolve(cb) end)
|
||||
@@ -85,6 +85,7 @@ RegisterNetEvent('jim-payments:client:Charge', function(data, outside)
|
||||
end
|
||||
--Check if image was given when opening the regsiter
|
||||
local img = data.img or ""
|
||||
if not string.find(img, "<") then img = "<center><p><img src="..img.." width=100px></p>" end
|
||||
--Continue adding payment options to qb-input
|
||||
newinputs[#newinputs+1] = { type = 'radio', name = 'billtype', text = Loc[Config.Lan].menu["type"], options = { { value = "cash", text = Loc[Config.Lan].menu["cash"] }, { value = "bank", text = Loc[Config.Lan].menu["card"] } } }
|
||||
newinputs[#newinputs+1] = { type = 'number', isRequired = true, name = 'price', text = Loc[Config.Lan].menu["amount_charge"] }
|
||||
@@ -97,6 +98,9 @@ RegisterNetEvent('jim-payments:client:Charge', function(data, outside)
|
||||
if not dialog.citizen or not dialog.price then return end
|
||||
TriggerServerEvent('jim-payments:server:Charge', dialog.citizen, dialog.price, dialog.billtype, data.img, outside, gang)
|
||||
end
|
||||
if Config.Usebzzz then
|
||||
ExecuteCommand("e c")
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('jim-payments:client:PolCharge', function()
|
||||
|
||||
51
config.lua
51
config.lua
@@ -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.^45 ^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.
|
||||
|
||||
@@ -7,13 +7,19 @@ print("^2Jim^7-^2Payments ^7v^42^7.^48^7.^41 ^7- ^2Payments Script by ^1Jimathy^
|
||||
Config = {
|
||||
Lan = "en",
|
||||
Debug = false,
|
||||
Notify = "qb",
|
||||
Notify = "qb", -- "qb" | "okok" | "t" | "infinity" | "rr"
|
||||
|
||||
---------------------------------
|
||||
-- Default Job Payment Systems --
|
||||
---------------------------------
|
||||
Manage = true, -- "true" if using qb-management
|
||||
-- "false" if using qb-bossmenu
|
||||
|
||||
Banking = "qb-banking",
|
||||
-- "qb-management" - This is for the older version of QBCore
|
||||
-- "qb-banking" - This is for the latest QBCore updates
|
||||
-- "renewed"
|
||||
-- "fd" - currently default supported
|
||||
|
||||
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
|
||||
PaymentRadius = 15, -- This is how far the playerlist will check for nearby players (based on the person charging)
|
||||
@@ -36,7 +42,10 @@ Config = {
|
||||
`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
|
||||
Usebzzz = false, -- enable if you're using the prop from bzzz
|
||||
Enablecommand = true, -- Enables the cashregister command
|
||||
|
||||
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 is helpful for phones that don't support invoices well
|
||||
|
||||
@@ -59,6 +68,8 @@ Config = {
|
||||
-- PayPerTicket should never be higher than MinAmountforTicket
|
||||
-- Commission is a percentage eg "0.10" becomes 10%
|
||||
Jobs = {
|
||||
-- Jim Businesses | https://jimathy666.tebex.io/
|
||||
['bakery'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
['beanmachine'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
['burgershot'] = { MinAmountforTicket = 50, PayPerTicket = 50 , Commission = 0.10, },
|
||||
['catcafe'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
@@ -67,8 +78,27 @@ Config = {
|
||||
['popsdiner'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
['tequilala'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
['vanilla'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
['upnatom'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
['hornys'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
|
||||
-- JixelTay Businesses | https://jixeltay.tebex.io/
|
||||
['cigarbar'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
['cluckinbell'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
['smokeshop'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
['pearls'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
['kois'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
['whitewidow'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
['bestbuds'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
|
||||
|
||||
-- Jim Mechanic | https://jimathy666.tebex.io/
|
||||
['mechanic'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
|
||||
['lostmc'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, gang = true, }, -- Example of a gang being supported
|
||||
['tuners'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
|
||||
['ottos'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
|
||||
['lscustoms'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
|
||||
['bennys'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
|
||||
|
||||
-- Gangs | Example of a gang being supported
|
||||
['lostmc'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, gang = true, },
|
||||
},
|
||||
|
||||
------------------------------
|
||||
@@ -77,7 +107,10 @@ Config = {
|
||||
-- This adds the ability to add multiple locations for each job
|
||||
-- Basically adding ready made locations, all you need to a vector4 and to confrim if you need a new prop in that location
|
||||
CustomCashRegisters = {
|
||||
|
||||
-- ["jobname"] = { -- Player job role restriction
|
||||
-- { coords = vector4(0, 0, 0, 0), prop = true, }, -- vector4 to place the till and the way it faces
|
||||
-- { coords = vector4(0, 0, 0, 0), prop = true, }, -- "prop = true" spawns a prop at the coords
|
||||
-- },
|
||||
},
|
||||
|
||||
-- The /polcharge command requires specific jobs to be set
|
||||
@@ -89,8 +122,6 @@ Config = {
|
||||
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
|
||||
|
||||
RenewedBanking = false, -- Enable if using renewed banking
|
||||
ApGov = false, -- Add support for AP-Goverment Tax
|
||||
---------------------
|
||||
-- Banking Systems --
|
||||
---------------------
|
||||
@@ -99,7 +130,7 @@ Config = {
|
||||
BankBlips = false, -- Enable this if you disabled qb-banking and need bank locations
|
||||
ATMBlips = false, -- Enable this if you are a pyscho and need every ATM to be on the map too
|
||||
|
||||
Gabz = true, -- "true" to enable Gabz Bank locations
|
||||
Gabz = false, -- "true" to enable Gabz Bank locations
|
||||
-- this corrects the ATM/Bank Cashier + Ticket Cash in location
|
||||
|
||||
ATMModels = { `prop_atm_01`, `prop_atm_02`, `prop_atm_03`, `prop_fleeca_atm` },
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
name "Jim-Payments"
|
||||
author "Jimathy"
|
||||
version "v2.8.1"
|
||||
version "v2.8.7"
|
||||
description "Payment Script By Jimathy"
|
||||
fx_version "cerulean"
|
||||
game "gta5"
|
||||
lua54 'yes'
|
||||
|
||||
dependencies { 'qb-input', 'qb-target', }
|
||||
client_scripts { 'client/*.lua', 'locales/*.lua' }
|
||||
server_scripts { '@oxmysql/lib/MySQL.lua', 'server/*.lua' }
|
||||
shared_scripts { 'config.lua', 'shared/*.lua', 'locales/*.lua' }
|
||||
client_scripts { 'client/*.lua', }
|
||||
server_scripts { '@oxmysql/lib/MySQL.lua', 'server/*.lua' }
|
||||
|
||||
134
locales/da.lua
Normal file
134
locales/da.lua
Normal file
@@ -0,0 +1,134 @@
|
||||
-- Provided by iplayer1337fivem on Github
|
||||
Loc["da"] = {
|
||||
error = {
|
||||
["cancel"] = "Afbestilt",
|
||||
["no_one"] = "Ingen i nærheden at opkræve",
|
||||
["not_onduty"] = "Ikke logget ind!",
|
||||
["no_job"] = "Du har ikke det påkrævede job",
|
||||
["no_ticket"] = "Du har ingen billetter at handle med",
|
||||
["bank_low"] = "Bankbalance for lav",
|
||||
["no_cash"] = "Ikke nok kontanter",
|
||||
["saving_low"] = "Savings balance for lav",
|
||||
["soc_low"] = "Society balance for lav",
|
||||
["nomoney_bank"] = "Ikke nok penge på din bankkonto",
|
||||
["error_start"] = "Fejl: Konto '",
|
||||
["error_end"] = "' ikke fundet",
|
||||
["not_enough"] = "Du har ikke nok kontanter til at give",
|
||||
["zero"] = "Du kan ikke give DKK0",
|
||||
["charge_zero"] = "Du kan ikke opkræve 0 DKK",
|
||||
["no_ticket_to"] = "Ingen billetter at handle med",
|
||||
["customer_nocash"] = "Kunden har ikke nok kontanter til at betale",
|
||||
["you_nocash"] = "Du har ikke nok kontanter til at betale",
|
||||
["decline_pay"] = " afslog DKK",
|
||||
["declined_payment"] = "Du afslog betalingen",
|
||||
},
|
||||
success = {
|
||||
["draw"] = "Hævet DKK",
|
||||
["from_bank"] = " fra banken",
|
||||
["deposited"] = "Indsat DKK",
|
||||
["into_bank"] = " på bankkontoen",
|
||||
["draw_save"] = " Trukket fra opsparingskontoen til bankkontoen",
|
||||
["depos_save"] = " Indsat fra bankkontoen til opsparingen",
|
||||
["fromthe"] = " fra ",
|
||||
["into"] = " til ",
|
||||
["account"] = " konto",
|
||||
["sent"] = "Sendt DKK",
|
||||
["recieved"] = "Modtaget DKK",
|
||||
["to"] = " til ",
|
||||
["from"] = " fra ",
|
||||
["you_gave"] = "Du gav ",
|
||||
["you_got"] = "Du fik DKK",
|
||||
["invoice_start"] = " Betalte deres DKK",
|
||||
["invoice_end"] = " faktura",
|
||||
["rec_rec"] = "Kvittering modtaget",
|
||||
["commission"] = " i provision",
|
||||
["trade_ticket_start"] = "Billetter handlet: ",
|
||||
["trade_ticket_end"] = " I alt: DKK",
|
||||
["inv_succ"] = "Faktura sendt med succes",
|
||||
["inv_recieved"] = "Ny faktura modtaget",
|
||||
["declined"] = "Du afslog betalingen",
|
||||
["accepted_pay"] = " accepterede DKK",
|
||||
["payment"] = " betaling",
|
||||
["charged"] = " blev opkrævet for DKK",
|
||||
["you_charged"] = "Du blev opkrævet for DKK",
|
||||
["charge_end"] = " opkrævning",
|
||||
},
|
||||
blip = {
|
||||
["blip_atm"] = "Hæveautomat",
|
||||
["blip_bank"] = "Bank",
|
||||
},
|
||||
command = {
|
||||
["pay_user"] = "Betal en bruger i nærheden",
|
||||
["cash_reg"] = "Brug mobil kontantregister",
|
||||
["charge"] = "Opkræv en anden person",
|
||||
},
|
||||
target = {
|
||||
["atm"] = "Brug hæveautomat",
|
||||
["bank"] = "Brug bank",
|
||||
["transfer"] = "Overfør penge",
|
||||
["saving"] = "Adgang til opsparing",
|
||||
["soc_saving"] = "Adgang til society-konto",
|
||||
["soc_trans"] = "Society pengetransfer",
|
||||
["gang_acct"] = "Gang Society-konto",
|
||||
["gang_trans"] = "Gang pengetransfer",
|
||||
["charge"] = "Opkræv kunde",
|
||||
["cashin_boss"] = "Indbetal jobkvitteringer",
|
||||
["cashin_gang"] = "Indbetal gangkvitteringer",
|
||||
},
|
||||
menu = {
|
||||
["close"] = "Luk",
|
||||
["withdraw"] = "Hæv",
|
||||
["deposit"] = "Indsæt",
|
||||
["transfer"] = "Overfør",
|
||||
["transfer_money"] = "Overfør penge",
|
||||
["header_atm"] = "💵 Hæveautomat Bank 💵",
|
||||
["header_trans_amount"] = "💵 Beløb at overføre",
|
||||
["header_bank"] = "🏦 Bankvæsen 🏦",
|
||||
["header_trans"] = "🔀 Overførselsservice 🔀",
|
||||
["header_account_no"] = "🏦 Kontonr.",
|
||||
["header_saving"] = "💰 Opsparing 💰",
|
||||
["acc_atm"] = "Adgang til hæveautomat",
|
||||
["acc_bank"] = "Adgang til bank",
|
||||
["acc_trans"] = "Adgang til overførsler",
|
||||
["acc_saving"] = "Adgang til opsparing",
|
||||
["acc_boss"] = "Adgang til society-konto",
|
||||
["acc_boss_trans"] = "Adgang til society-overførsler",
|
||||
["acc_gang"] = "Adgang til gang-society-konto",
|
||||
["acc_gang_trans"] = "Adgang til gangoverførsler",
|
||||
["header_soc"] = "<br><br>- Society-konto -<br>",
|
||||
["header_balance"] = "<br><br>- Balancer -<br>🏢",
|
||||
["header_soc_bank"] = "🏢 Society Bank 🏢",
|
||||
["amount_pay"] = "💵 Beløb at betale",
|
||||
["give_cash"] = "Giv nogen kontanter",
|
||||
["give"] = "Giv",
|
||||
["welcome"] = "Velkommen tilbage, ",
|
||||
["citizenid"] = "<br><br>- Borger-ID -<br>",
|
||||
["header_acc"] = "<br><br>- Konto -<br>",
|
||||
["header_info"] = "<br><br>- Kontoinformation -<br>Opsparings-ID: ",
|
||||
["header_balance_bank"] = "<br><br>- Balancer -<br>🏦Bank - DKK",
|
||||
["header_option"] = "<br><br>- Valg -",
|
||||
["cash_balance"] = "<br>💵Kontanter - DKK",
|
||||
["bank_balance"] = "<br>🏦Bank - DKK",
|
||||
["saving_balance"] = "<br><br>- Balancer -<br>💰Opsparing - DKK",
|
||||
["cus_id"] = "# Kundens ID #",
|
||||
["type"] = "Betalingstype",
|
||||
["amount_charge"] = "💵 Beløb at opkræve",
|
||||
["cash_reg"] = "Kontantregister",
|
||||
["person_id"] = "# Personens ID #",
|
||||
["charge"] = "Opkræv",
|
||||
["send"] = "Send",
|
||||
["receipt"] = "Kvitteringer 🧾",
|
||||
["payment"] = " Betaling 🧾",
|
||||
["trade_confirm"] = "Vil du bytte dine kvitteringer til betaling?",
|
||||
["accept_payment"] = "Vil du acceptere betalingen?",
|
||||
["accept_charge"] = "Vil du acceptere opkrævningen?",
|
||||
["ticket_amount"] = "Antal billetter: ",
|
||||
["total_pay"] = "<br>Total betaling: DKK",
|
||||
["yes"] = "Ja",
|
||||
["no"] = "Nej",
|
||||
["cash"] = "Kontanter",
|
||||
["card"] = "Kort",
|
||||
["payment_amount"] = " Betaling: DKK",
|
||||
["bank_charge"] = "Bankgebyr: DKK",
|
||||
},
|
||||
}
|
||||
@@ -1,6 +1,3 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
RegisterNetEvent('QBCore:Server:UpdateObject', function() if source ~= '' then return false end QBCore = exports['qb-core']:GetCoreObject() end)
|
||||
|
||||
local function cv(amount)
|
||||
local formatted = amount
|
||||
while true do
|
||||
@@ -70,14 +67,18 @@ RegisterServerEvent('jim-payments:server:ATM:use', function(amount, billtype, ba
|
||||
elseif tonumber(society) >= amount then
|
||||
triggerNotify(nil, Loc[Config.Lan].success["draw"]..cv(amount)..Loc[Config.Lan].success["fromthe"]..Player.PlayerData.job.label..Loc[Config.Lan].success["account"], "success", src)
|
||||
Player.Functions.AddMoney('bank', amount)
|
||||
if Config.Manage then exports["qb-management"]:RemoveMoney(tostring(Player.PlayerData.job.name), amount)
|
||||
else TriggerEvent("qb-bossmenu:server:removeAccountMoney", tostring(Player.PlayerData.job.name), amount) end
|
||||
if Config.Banking == "renewed" then exports['Renewed-Banking']:removeAccountMoney(tostring(Player.PlayerData.job.name), amount)
|
||||
elseif Config.Banking == "qb-management" then exports["qb-management"]:RemoveMoney(tostring(Player.PlayerData.job.name), amount)
|
||||
elseif Config.Banking == "qb-banking" then exports["qb-banking"]:RemoveMoney(tostring(Player.PlayerData.job.name), amount)
|
||||
elseif Config.Banking == "fd" then exports.fd_banking:RemoveMoney(tostring(Player.PlayerData.job.name), amount) end
|
||||
end
|
||||
elseif billtype == "deposit" then
|
||||
if bankB < amount then triggerNotify(nil, Loc[Config.Lan].error["nomoney_bank"], "error", src)
|
||||
elseif bankB >= amount then
|
||||
if Config.Manage then exports["qb-management"]:AddMoney(tostring(Player.PlayerData.job.name), amount)
|
||||
else TriggerEvent("qb-bossmenu:server:addAccountMoney", tostring(Player.PlayerData.job.name), amount) end
|
||||
if Config.Banking == "renewed" then exports['Renewed-Banking']:addAccountMoney(tostring(Player.PlayerData.job.name), amount)
|
||||
elseif Config.Banking == "qb-management" then exports["qb-management"]:AddMoney(tostring(Player.PlayerData.job.name), amount)
|
||||
elseif Config.Banking == "qb-banking" then exports["qb-banking"]:AddMoney(tostring(Player.PlayerData.job.name), amount)
|
||||
elseif Config.Banking == "fd" then exports.fd_banking:AddMoney(tostring(Player.PlayerData.job.name), amount) end
|
||||
Player.Functions.RemoveMoney('bank', amount) Wait(1500)
|
||||
triggerNotify(nil, Loc[Config.Lan].success["deposited"]..cv(amount)..Loc[Config.Lan].success["into"]..Player.PlayerData.job.label..Loc[Config.Lan].success["account"], "success", src)
|
||||
end
|
||||
@@ -100,8 +101,10 @@ RegisterServerEvent('jim-payments:server:ATM:use', function(amount, billtype, ba
|
||||
local result = MySQL.Sync.fetchAll('SELECT * FROM players WHERE charinfo LIKE ?', {query})
|
||||
if result[1] then
|
||||
local Reciever = QBCore.Functions.GetPlayerByCitizenId(result[1].citizenid)
|
||||
if Config.Manage then exports["qb-management"]:RemoveMoney(tostring(Player.PlayerData.job.name), amount)
|
||||
else TriggerEvent("qb-bossmenu:server:removeAccountMoney", tostring(Player.PlayerData.job.name), amount) end
|
||||
if Config.Banking == "renewed" then exports['Renewed-Banking']:removeAccountMoney(tostring(Player.PlayerData.job.name), amount)
|
||||
elseif Config.Banking == "qb-management" then exports["qb-management"]:RemoveMoney(tostring(Player.PlayerData.job.name), amount)
|
||||
elseif Config.Banking == "qb-banking" then exports["qb-banking"]:RemoveMoney(tostring(Player.PlayerData.job.name), amount)
|
||||
elseif Config.Banking == "fd" then exports.fd_banking:RemoveMoney(tostring(Player.PlayerData.job.name), amount) end
|
||||
if Reciever then
|
||||
Reciever.Functions.AddMoney('bank', amount)
|
||||
triggerNotify(nil, Loc[Config.Lan].success["sent"]..amount..Loc[Config.Lan].success["to"]..Reciever.PlayerData.charinfo.firstname.." "..Reciever.PlayerData.charinfo.lastname, "success", src)
|
||||
@@ -122,14 +125,18 @@ RegisterServerEvent('jim-payments:server:ATM:use', function(amount, billtype, ba
|
||||
elseif tonumber(gsociety) >= amount then
|
||||
triggerNotify(nil, Loc[Config.Lan].success["draw"]..cv(amount)..Loc[Config.Lan].success["fromthe"]..Player.PlayerData.gang.label..Loc[Config.Lan].success["account"], "success", src)
|
||||
Player.Functions.AddMoney('bank', amount)
|
||||
if Config.Manage then exports["qb-management"]:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount)
|
||||
else TriggerEvent("qb-gangmenu:server:removeAccountMoney", tostring(Player.PlayerData.gang.name), amount) end
|
||||
if Config.Banking == "renewed" then exports['Renewed-Banking']:removeAccountMoney(tostring(Player.PlayerData.gang.name), amount)
|
||||
elseif Config.Banking == "qb-management" then exports["qb-management"]:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount)
|
||||
elseif Config.Banking == "qb-banking" then exports["qb-banking"]:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount)
|
||||
elseif Config.Banking == "fd" then exports.fd_banking:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount) end
|
||||
end
|
||||
elseif billtype == "deposit" then
|
||||
if bankB < amount then triggerNotify(nil, Loc[Config.Lan].error["nomoney_bank"], "error", src)
|
||||
elseif bankB >= amount then
|
||||
if Config.Manage then exports["qb-management"]:AddGangMoney(tostring(Player.PlayerData.gang.name), amount)
|
||||
else TriggerEvent("qb-gangmenu:server:addAccountMoney", tostring(Player.PlayerData.gang.name), amount) end
|
||||
if Config.Banking == "rewnewed" then exports['Renewed-Banking']:addAccountMoney(tostring(Player.PlayerData.gang.name), amount)
|
||||
elseif Config.Banking == "qb-management" then exports["qb-management"]:AddGangMoney(tostring(Player.PlayerData.gang.name), amount)
|
||||
elseif Config.Banking == "qb-banking" then exports["qb-banking"]:AddGangMoney(tostring(Player.PlayerData.gang.name), amount)
|
||||
elseif Config.Banking == "fd" then exports.fd_banking:AddGangMoney(tostring(Player.PlayerData.gang.name), amount) end
|
||||
Player.Functions.RemoveMoney('bank', amount) Wait(1500)
|
||||
triggerNotify(nil, Loc[Config.Lan].success["deposited"]..cv(amount)..Loc[Config.Lan].success["into"]..Player.PlayerData.gang.label..Loc[Config.Lan].success["account"], "success", src)
|
||||
end
|
||||
@@ -152,8 +159,10 @@ RegisterServerEvent('jim-payments:server:ATM:use', function(amount, billtype, ba
|
||||
local result = MySQL.Sync.fetchAll('SELECT * FROM players WHERE charinfo LIKE ?', {query})
|
||||
if result[1] then
|
||||
local Reciever = QBCore.Functions.GetPlayerByCitizenId(result[1].citizenid)
|
||||
if Config.Manage then exports["qb-management"]:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount)
|
||||
else TriggerEvent("qb-bossmenu:server:removeAccountMoney", tostring(Player.PlayerData.gang.name), amount) end
|
||||
if Config.Banking == "renewed" then exports['Renewed-Banking']:removeAccountMoney(tostring(Player.PlayerData.gang.name), amount)
|
||||
elseif Config.Banking == "qb-management" then exports["qb-management"]:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount)
|
||||
elseif Config.Banking == "qb-banking" then exports["qb-banking"]:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount)
|
||||
elseif Config.Banking == "fd" then exports.fd_banking:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount) end
|
||||
if not Reciever then
|
||||
Reciever.Functions.AddMoney('bank', amount)
|
||||
triggerNotify(nil, Loc[Config.Lan].success["sent"]..amount..Loc[Config.Lan].success["to"]..Reciever.PlayerData.charinfo.firstname.." "..Reciever.PlayerData.charinfo.lastname, "success", src)
|
||||
@@ -195,8 +204,8 @@ RegisterServerEvent('jim-payments:server:ATM:use', function(amount, billtype, ba
|
||||
RecieverMoney.bank += amount
|
||||
MySQL.Async.execute('UPDATE players SET money = ? WHERE citizenid = ?', {json.encode(RecieverMoney), result[1].citizenid})
|
||||
end
|
||||
elseif not result[1] then triggerNotify(nil, Loc[Config.Lan].error["error_start"]..baccount..Loc[Config.Lan].error["error_end"], "error", src)
|
||||
|
||||
elseif not result[1] then
|
||||
triggerNotify(nil, Loc[Config.Lan].error["error_start"]..baccount..Loc[Config.Lan].error["error_end"], "error", src)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -212,8 +221,19 @@ QBCore.Functions.CreateCallback('jim-payments:ATM:Find', function(source, cb)
|
||||
local society = 0
|
||||
local gsociety = 0
|
||||
|
||||
if Config.Banking == "qb-banking" then
|
||||
local result = MySQL.Sync.fetchAll('SELECT * FROM bank_accounts')
|
||||
for _, v in pairs(result) do
|
||||
if Player.PlayerData.job.name == v.job_name then society = v.amount end
|
||||
end
|
||||
if Player.PlayerData.gang.name ~= "none" then
|
||||
for _, v in pairs(result) do
|
||||
if Player.PlayerData.gang.name == v.job_name then gsociety = v.amount end
|
||||
end
|
||||
end
|
||||
|
||||
-- If qb-management, grab info directly from database
|
||||
if Config.Manage then
|
||||
elseif not Config.Banking == "renewed" then
|
||||
local result = MySQL.Sync.fetchAll('SELECT * FROM management_funds')
|
||||
for _, v in pairs(result) do
|
||||
if Player.PlayerData.job.name == v.job_name then society = v.amount end
|
||||
@@ -267,3 +287,4 @@ RegisterServerEvent("jim-payments:server:ATM:give", function(citizen, price)
|
||||
end
|
||||
else triggerNotify(nil, Loc[Config.Lan].error["zero"], 'error', source) end
|
||||
end)
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
RegisterNetEvent('QBCore:Server:UpdateObject', function() if source ~= '' then return false end QBCore = exports['qb-core']:GetCoreObject() end)
|
||||
|
||||
local function cv(amount)
|
||||
local formatted = amount
|
||||
@@ -15,7 +13,13 @@ AddEventHandler('onResourceStart', function(resource) if GetCurrentResourceName(
|
||||
end
|
||||
end)
|
||||
|
||||
QBCore.Commands.Add("cashregister", Loc[Config.Lan].command["cash_reg"], {}, false, function(source) TriggerClientEvent("jim-payments:client:Charge", source, {}, true) end)
|
||||
|
||||
CreateThread(function()
|
||||
if Config.Enablecommand then
|
||||
QBCore.Commands.Add("cashregister", Loc[Config.Lan].command["cash_reg"], {}, false, function(source) TriggerClientEvent("jim-payments:client:Charge", source, {}, true) end)
|
||||
end
|
||||
end)
|
||||
|
||||
QBCore.Commands.Add("polcharge", Loc[Config.Lan].command["charge"], {}, false, function(source) TriggerClientEvent("jim-payments:client:PolCharge", source) end)
|
||||
|
||||
RegisterServerEvent('jim-payments:Tickets:Give', function(data, biller, gang)
|
||||
@@ -23,26 +27,33 @@ RegisterServerEvent('jim-payments:Tickets:Give', function(data, biller, gang)
|
||||
local takecomm = math.floor(tonumber(data.amount) * Config.Jobs[data.society].Commission)
|
||||
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
|
||||
if 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
|
||||
else
|
||||
if Config.Banking == "renewed" then
|
||||
exports['Renewed-Banking']:addAccountMoney(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['Renewed-Banking']:getAccountMoney(biller.PlayerData.gang.name).."^7)") end
|
||||
elseif Config.Banking == "qb-management" then
|
||||
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
|
||||
end
|
||||
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-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
|
||||
elseif Config.Banking == "qb-banking" then
|
||||
exports["qb-banking"]:AddGangMoney(tostring(biller.PlayerData.gang.name), data.amount - takecomm)
|
||||
if Config.Debug then print("^5Debug^7: ^3QB-Banking^7(^3Gang^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.gang.name).."^7' ($^6"..exports["qb-banking"]:GetGangAccount(biller.PlayerData.gang.name).."^7)") end
|
||||
elseif Config.Banking == "fd" then
|
||||
exports.fd_banking:AddGangMoney(tostring(biller.PlayerData.gang.name), data.amount - takecomm)
|
||||
if Config.Debug then print("^5Debug^7: ^3FD-Banking^7(^3Gang^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.gang.name).."^7' ($^6"..exports.fd_banking:GetGangAccount(biller.PlayerData.gang.name).."^7)") end
|
||||
end
|
||||
elseif not gang then
|
||||
if Config.Manage then
|
||||
if 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
|
||||
else
|
||||
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - takecomm)
|
||||
if Config.Debug then print("^5Debug^7: ^3QB-Management^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports["qb-management"]:GetAccount(biller.PlayerData.job.name).."^7)") end
|
||||
end
|
||||
else TriggerEvent("qb-bossmenu:server:addAccountMoney", tostring(biller.PlayerData.job.name), data.amount - takecomm)
|
||||
if Config.Debug then print("^5Debug^7: ^3QB-BossMenu^7: ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name - takecomm).."^7'") end
|
||||
if Config.Banking == "renewed"
|
||||
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"..tostring(exports['Renewed-Banking']:getAccountMoney(biller.PlayerData.job.name)).."^7)") end
|
||||
elseif Config.Banking == "qb-management" then
|
||||
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - takecomm)
|
||||
if Config.Debug then print("^5Debug^7: ^3QB-Management^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports["qb-management"]:GetAccount(biller.PlayerData.job.name).."^7)") end
|
||||
elseif Config.Banking == "qb-banking" then
|
||||
exports["qb-banking"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - takecomm)
|
||||
if Config.Debug then print("^5Debug^7: ^3QB-Banking^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6^7)") end
|
||||
elseif Config.Banking == "fd" then
|
||||
exports.fd_banking:AddMoney(tostring(biller.PlayerData.job.name), data.amount - takecomm)
|
||||
if Config.Debug then print("^5Debug^7: ^3FD-Banking^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports.fd_banking:GetAccount(biller.PlayerData.job.name).."^7)") end
|
||||
end
|
||||
end
|
||||
elseif not biller then --Find the biller from their citizenid
|
||||
@@ -53,35 +64,33 @@ RegisterServerEvent('jim-payments:Tickets:Give', function(data, biller, gang)
|
||||
triggerNotify(nil, data.sender..Loc[Config.Lan].success["invoice_start"]..data.amount..Loc[Config.Lan].success["invoice_end"], "success", biller.PlayerData.source)
|
||||
end
|
||||
|
||||
local duty = true
|
||||
if not biller.PlayerData.job.onduty or gang == nil then duty = false end
|
||||
|
||||
-- If ticket system enabled, do this
|
||||
if duty and Config.TicketSystem then
|
||||
if (biller.PlayerData.job.onduty or gang) and Config.TicketSystem then
|
||||
if data.amount >= Config.Jobs[data.society].MinAmountforTicket then
|
||||
if Config.TicketSystemAll then
|
||||
for _, v in pairs(QBCore.Functions.GetPlayers()) do
|
||||
local Player = QBCore.Functions.GetPlayer(v)
|
||||
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})
|
||||
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)
|
||||
if gang then
|
||||
if Player.PlayerData.gang.name == data.society then
|
||||
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)
|
||||
end
|
||||
else
|
||||
if Player.PlayerData.job.name == data.society and Player.PlayerData.job.onduty then
|
||||
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)
|
||||
end
|
||||
end
|
||||
end
|
||||
if gang then
|
||||
biller.Functions.AddItem('payticket', 1, false, {["quality"] = nil})
|
||||
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
|
||||
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)
|
||||
TriggerClientEvent('inventory:client:ItemBox', biller.PlayerData.source, QBCore.Shared.Items['payticket'], "add", 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Commission section, does each config option separately
|
||||
local comm = tonumber(Config.Jobs[data.society].Commission)
|
||||
if Config.Commission and comm ~= 0 then
|
||||
@@ -143,7 +152,11 @@ RegisterServerEvent("jim-payments:server:Charge", function(citizen, price, billt
|
||||
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})
|
||||
{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)
|
||||
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)', {
|
||||
@@ -191,15 +204,19 @@ RegisterServerEvent("jim-payments:server:PolCharge", function(citizen, price)
|
||||
if billed.Functions.RemoveMoney("bank", price) then if Config.Debug then print("^5Debug^7: ^3PolCharge^7 - ^2Player^7(^6"..billed.PlayerData.source.."^7) ^2charged ^7$^6"..price.."^7") end 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 Config.Manage then
|
||||
if 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
|
||||
else
|
||||
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), (price - commission))
|
||||
if Config.Debug then print("^5Debug^7: ^3QB-Management^7(^3Job^7): ^2Adding ^7$^6"..(price - takecomm).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports["qb-management"]:GetAccount(biller.PlayerData.job.name).."^7)") end
|
||||
end
|
||||
else TriggerEvent("qb-bossmenu:server:addAccountMoney", tostring(biller.PlayerData.job.name), price - takecomm)
|
||||
if Config.Debug then print("^5Debug^7: ^3QB^7-^3Bossmenu^7(^3Job^7): ^2Adding ^7$^6"..(price - commission).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7'") end
|
||||
|
||||
if Config.Banking == "renewed" 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
|
||||
elseif Config.Banking == "qb-management" then
|
||||
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), (price - commission))
|
||||
if Config.Debug then print("^5Debug^7: ^3QB-Management^7(^3Job^7): ^2Adding ^7$^6"..(price - takecomm).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports["qb-management"]:GetAccount(biller.PlayerData.job.name).."^7)") end
|
||||
elseif Config.Banking == "qb-banking" then
|
||||
exports["qb-banking"]:AddMoney(tostring(biller.PlayerData.job.name), (price - commission))
|
||||
if Config.Debug then print("^5Debug^7: ^3QB-Banking^7(^3Job^7): ^2Adding ^7$^6"..(price - takecomm).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports["qb-banking"]:GetAccount(biller.PlayerData.job.name).."^7)") end
|
||||
elseif Config.Banking == "fd" then
|
||||
exports.fd_banking:AddMoney(tostring(biller.PlayerData.job.name), (price - commission))
|
||||
if Config.Debug then print("^5Debug^7: ^3QB-Banking^7(^3Job^7): ^2Adding ^7$^6"..(price - takecomm).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports.fd_banking:GetAccount(biller.PlayerData.job.name).."^7)") end
|
||||
end
|
||||
triggerNotify(nil, billed.PlayerData.charinfo.firstname..Loc[Config.Lan].success["charged"]..(price - commission), "success", src)
|
||||
triggerNotify(nil, Loc[Config.Lan].success["you_charged"]..(price - commission), nil, billed.PlayerData.source)
|
||||
@@ -220,15 +237,19 @@ RegisterServerEvent("jim-payments:server:PolPopup", function(data)
|
||||
if Config.ApGov then exports['ap-government']:chargeCityTax(billed.PlayerData.source, "Item", data.amount) end
|
||||
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 Config.Manage then
|
||||
if 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
|
||||
else
|
||||
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - commission)
|
||||
if Config.Debug then print("^5Debug^7: ^3QB-Management^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports["qb-management"]:GetAccount(biller.PlayerData.job.name).."^7)") end
|
||||
end
|
||||
else TriggerEvent("qb-bossmenu:server:addAccountMoney", tostring(biller.PlayerData.job.name), data.amount - takecomm)
|
||||
if Config.Debug then print("^5Debug^7: ^3QB^7-^3Bossmenu^7(^3Job^7): ^2Adding ^7$^6"..(data.amount - commission).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7'") end
|
||||
|
||||
if Config.Banking == "renewed" 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
|
||||
elseif Config.Banking == "qb-management" then
|
||||
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - commission)
|
||||
if Config.Debug then print("^5Debug^7: ^3QB-Management^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports["qb-management"]:GetAccount(biller.PlayerData.job.name).."^7)") end
|
||||
elseif Config.Banking == "qb-banking" then
|
||||
exports["qb-banking"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - commission)
|
||||
if Config.Debug then print("^5Debug^7: ^3QB-Banking^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports["qb-banking"]:GetAccount(biller.PlayerData.job.name).."^7)") end
|
||||
elseif Config.Banking == "fd" then
|
||||
exports.fd_banking:AddMoney(tostring(biller.PlayerData.job.name), data.amount - commission)
|
||||
if Config.Debug then print("^5Debug^7: ^3FD-Banking^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports.fd_banking:GetAccount(biller.PlayerData.job.name).."^7)") end
|
||||
end
|
||||
else
|
||||
triggerNotify(nil, Loc[Config.Lan].error["declined_payment"], nil, src)
|
||||
@@ -244,3 +265,12 @@ QBCore.Functions.CreateCallback('jim-payments:MakePlayerList', function(source,
|
||||
end
|
||||
cb(onlineList)
|
||||
end)
|
||||
|
||||
|
||||
CreateThread(function()
|
||||
if Config.Usebzzz then
|
||||
QBCore.Functions.CreateUseableItem('terminal', function(source, item)
|
||||
TriggerClientEvent("jim-payments:client:Charge", source, {}, true)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
@@ -1,5 +1,4 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
RegisterNetEvent('QBCore:Client:UpdateObject', function() QBCore = exports['qb-core']:GetCoreObject() end)
|
||||
QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
local time = 1000
|
||||
function loadModel(model) if not HasModelLoaded(model) then
|
||||
|
||||
Reference in New Issue
Block a user