From 61e2e6f32ea8b1edc5554609c9cce758724d4e1c Mon Sep 17 00:00:00 2001 From: Jim Shield Date: Sat, 8 Oct 2022 19:26:21 +0100 Subject: [PATCH] v2.8.4 - Discontinue support for qb-bossmenu --- config.lua | 12 +++++----- fxmanifest.lua | 2 +- server/server.lua | 59 ++++++++++++++++++----------------------------- 3 files changed, 30 insertions(+), 43 deletions(-) diff --git a/config.lua b/config.lua index cbce94f..656ff55 100644 --- a/config.lua +++ b/config.lua @@ -1,4 +1,4 @@ -print("^2Jim^7-^2Payments ^7v^42^7.^48^7.^43 ^7- ^2Payments Script by ^1Jimathy^7") +print("^2Jim^7-^2Payments ^7v^42^7.^48^7.^44 ^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. @@ -6,16 +6,15 @@ print("^2Jim^7-^2Payments ^7v^42^7.^48^7.^43 ^7- ^2Payments Script by ^1Jimathy^ Config = { Lan = "en", - Debug = false, + Debug = true, Notify = "qb", --------------------------------- -- Default Job Payment Systems -- --------------------------------- - Manage = true, -- "true" if using qb-management - -- "false" if using qb-bossmenu - RenewedBanking = false, -- Enable if using Renewed-Banking (requires Manage to be true and leaving jim-payments banking part separate) + RenewedBanking = true, -- Enable if using Renewed-Banking false if using QB-Management + 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 @@ -39,7 +38,7 @@ 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 + 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 @@ -63,6 +62,7 @@ Config = { -- Commission is a percentage eg "0.10" becomes 10% Jobs = { ['beanmachine'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, + ['bakery'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['burgershot'] = { MinAmountforTicket = 50, PayPerTicket = 50 , Commission = 0.10, }, ['catcafe'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['henhouse'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, diff --git a/fxmanifest.lua b/fxmanifest.lua index 2a0f5fd..87d0653 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -1,6 +1,6 @@ name "Jim-Payments" author "Jimathy" -version "v2.8.3" +version "v2.8.4" description "Payment Script By Jimathy" fx_version "cerulean" game "gta5" diff --git a/server/server.lua b/server/server.lua index 57cac5a..150d233 100644 --- a/server/server.lua +++ b/server/server.lua @@ -23,26 +23,18 @@ 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 Config.RenewedBanking 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 - else - exports["qb-management"]:AddGangMoney(tostring(biller.PlayerData.gang.name), data.amount - takecomm) - 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 - 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.RenewedBanking 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 + else + exports["qb-management"]:AddGangMoney(tostring(biller.PlayerData.gang.name), data.amount - takecomm) + 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 elseif not gang then - if Config.Manage then - 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 - 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.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"..tostring(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 end elseif not biller then --Find the biller from their citizenid @@ -192,16 +184,14 @@ 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 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 - 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.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 + 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) else @@ -221,15 +211,12 @@ 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 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 - 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.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 triggerNotify(nil, Loc[Config.Lan].error["declined_payment"], nil, src)