mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 22:16:03 +01:00
More + optimization
This commit is contained in:
@@ -12,112 +12,122 @@
|
||||
]]
|
||||
|
||||
local societyFunc = {
|
||||
{
|
||||
bankName = "qb-banking",
|
||||
getAccount = function(society)
|
||||
if not exports["qb-banking"]:GetAccount(society) then
|
||||
if Jobs[society] then
|
||||
print("^6Bridge^7: ^2Making new bank account in ^7'^3qb-banking^7' ^2for ^7'^3"..society.."^7'")
|
||||
exports["qb-banking"]:CreateJobAccount(society, 0)
|
||||
Wait(150)
|
||||
elseif Gangs[society] then
|
||||
print("^6Bridge^7: ^2Making new bank account in ^7'^3qb-banking^7' ^2for ^7'^3"..society.."^7'")
|
||||
exports["qb-banking"]:CreateGangAccount(society, 0)
|
||||
Wait(150)
|
||||
{ bankName = "qb-banking",
|
||||
getAccount =
|
||||
function(society)
|
||||
if not exports["qb-banking"]:GetAccount(society) then
|
||||
if Jobs[society] then
|
||||
print("^6Bridge^7: ^2Making new bank account in ^7'^3qb-banking^7' ^2for ^7'^3"..society.."^7'")
|
||||
exports["qb-banking"]:CreateJobAccount(society, 0)
|
||||
Wait(150)
|
||||
elseif Gangs[society] then
|
||||
print("^6Bridge^7: ^2Making new bank account in ^7'^3qb-banking^7' ^2for ^7'^3"..society.."^7'")
|
||||
exports["qb-banking"]:CreateGangAccount(society, 0)
|
||||
Wait(150)
|
||||
end
|
||||
end
|
||||
end
|
||||
return exports["qb-banking"]:GetAccountBalance(society)
|
||||
end,
|
||||
chargeSociety = function(society, amount)
|
||||
if not exports["qb-banking"]:GetAccount(society) then
|
||||
if Jobs[society] then
|
||||
print("^6Bridge^7: ^2Making new bank account in ^7'^3qb-banking^7' ^2for ^7'^3"..society.."^7'")
|
||||
exports["qb-banking"]:CreateJobAccount(society, 0) Wait(150) -- make new account if return "null"
|
||||
elseif Gangs[society] then
|
||||
print("^6Bridge^7: ^2Making new bank account in ^7'^3qb-banking^7' ^2for ^7'^3"..society.."^7'")
|
||||
exports["qb-banking"]:CreateGangAccount(society, 0) Wait(150) -- make new account if return "null"
|
||||
return exports["qb-banking"]:GetAccountBalance(society)
|
||||
end,
|
||||
chargeSociety =
|
||||
function(society, amount)
|
||||
if not exports["qb-banking"]:GetAccount(society) then
|
||||
if Jobs[society] then
|
||||
print("^6Bridge^7: ^2Making new bank account in ^7'^3qb-banking^7' ^2for ^7'^3"..society.."^7'")
|
||||
exports["qb-banking"]:CreateJobAccount(society, 0) Wait(150) -- make new account if return "null"
|
||||
elseif Gangs[society] then
|
||||
print("^6Bridge^7: ^2Making new bank account in ^7'^3qb-banking^7' ^2for ^7'^3"..society.."^7'")
|
||||
exports["qb-banking"]:CreateGangAccount(society, 0) Wait(150) -- make new account if return "null"
|
||||
end
|
||||
end
|
||||
end
|
||||
exports["qb-banking"]:RemoveMoney(society, amount)
|
||||
end,
|
||||
fundSociety = function(society, amount)
|
||||
if not exports["qb-banking"]:GetAccount(society) then
|
||||
if Jobs[society] then
|
||||
print("^6Bridge^7: ^2Making new bank account in ^7'^3qb-banking^7' ^2for ^7'^3"..society.."^7'")
|
||||
exports["qb-banking"]:CreateJobAccount(society, 0)
|
||||
Wait(150)
|
||||
elseif Gangs[society] then
|
||||
print("^6Bridge^7: ^2Making new bank account in ^7'^3qb-banking^7' ^2for ^7'^3"..society.."^7'")
|
||||
exports["qb-banking"]:CreateGangAccount(society, 0)
|
||||
Wait(150)
|
||||
exports["qb-banking"]:RemoveMoney(society, amount)
|
||||
end,
|
||||
fundSociety =
|
||||
function(society, amount)
|
||||
if not exports["qb-banking"]:GetAccount(society) then
|
||||
if Jobs[society] then
|
||||
print("^6Bridge^7: ^2Making new bank account in ^7'^3qb-banking^7' ^2for ^7'^3"..society.."^7'")
|
||||
exports["qb-banking"]:CreateJobAccount(society, 0)
|
||||
Wait(150)
|
||||
elseif Gangs[society] then
|
||||
print("^6Bridge^7: ^2Making new bank account in ^7'^3qb-banking^7' ^2for ^7'^3"..society.."^7'")
|
||||
exports["qb-banking"]:CreateGangAccount(society, 0)
|
||||
Wait(150)
|
||||
end
|
||||
end
|
||||
end
|
||||
exports["qb-banking"]:AddMoney(society, amount)
|
||||
end,
|
||||
exports["qb-banking"]:AddMoney(society, amount)
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
bankName = "Renewed-Banking",
|
||||
getAccount = function(society)
|
||||
return exports["Renewed-Banking"]:getAccountMoney(society)
|
||||
end,
|
||||
chargeSociety = function(society, amount)
|
||||
exports['Renewed-Banking']:removeAccountMoney(society, amount)
|
||||
end,
|
||||
fundSociety = function(society, amount)
|
||||
exports['Renewed-Banking']:addAccountMoney(society, amount)
|
||||
end,
|
||||
{ bankName = "Renewed-Banking",
|
||||
getAccount =
|
||||
function(society)
|
||||
return exports["Renewed-Banking"]:getAccountMoney(society)
|
||||
end,
|
||||
chargeSociety =
|
||||
function(society, amount)
|
||||
exports['Renewed-Banking']:removeAccountMoney(society, amount)
|
||||
end,
|
||||
fundSociety =
|
||||
function(society, amount)
|
||||
exports['Renewed-Banking']:addAccountMoney(society, amount)
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
bankName = "fd_banking",
|
||||
getAccount = function(society)
|
||||
return exports["fd_banking"]:GetAccount(society)
|
||||
end,
|
||||
chargeSociety = function(society, amount)
|
||||
exports["fd_banking"]:RemoveMoney(society, amount)
|
||||
end,
|
||||
fundSociety = function(society, amount)
|
||||
exports["fd_banking"]:AddMoney(society, amount)
|
||||
end,
|
||||
{ bankName = "fd_banking",
|
||||
getAccount =
|
||||
function(society)
|
||||
return exports["fd_banking"]:GetAccount(society)
|
||||
end,
|
||||
chargeSociety =
|
||||
function(society, amount)
|
||||
exports["fd_banking"]:RemoveMoney(society, amount)
|
||||
end,
|
||||
fundSociety =
|
||||
function(society, amount)
|
||||
exports["fd_banking"]:AddMoney(society, amount)
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
bankName = "okokBanking",
|
||||
getAccount = function(society)
|
||||
return exports['okokBanking']:GetAccount(society)
|
||||
end,
|
||||
chargeSociety = function(society, amount)
|
||||
exports['okokBanking']:RemoveMoney(society, amount)
|
||||
end,
|
||||
fundSociety = function(society, amount)
|
||||
exports['okokBanking']:AddMoney(society, amount)
|
||||
end,
|
||||
{ bankName = "okokBanking",
|
||||
getAccount =
|
||||
function(society)
|
||||
return exports['okokBanking']:GetAccount(society)
|
||||
end,
|
||||
chargeSociety =
|
||||
function(society, amount)
|
||||
exports['okokBanking']:RemoveMoney(society, amount)
|
||||
end,
|
||||
fundSociety =
|
||||
function(society, amount)
|
||||
exports['okokBanking']:AddMoney(society, amount)
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
bankName = "tgiann-bank",
|
||||
getAccount = function(society)
|
||||
if Jobs[society] then
|
||||
return exports["tgiann-bank"]:GetJobAccountBalance(society)
|
||||
else
|
||||
return exports["tgiann-bank"]:GetGangAccountBalance(society)
|
||||
end
|
||||
end,
|
||||
chargeSociety = function(society, amount)
|
||||
if Jobs[society] then
|
||||
exports["tgiann-bank"]:RemoveJobMoney(society, amount)
|
||||
else
|
||||
exports["tgiann-bank"]:RemoveGangMoney(society, amount)
|
||||
end
|
||||
end,
|
||||
fundSociety = function(society, amount)
|
||||
if Jobs[society] then
|
||||
exports["tgiann-bank"]:AddJobMoney(society, amount)
|
||||
else
|
||||
exports["tgiann-bank"]:AddGangMoney(society, amount)
|
||||
end
|
||||
end,
|
||||
{ bankName = "tgiann-bank",
|
||||
getAccount =
|
||||
function(society)
|
||||
if Jobs[society] then
|
||||
return exports["tgiann-bank"]:GetJobAccountBalance(society)
|
||||
else
|
||||
return exports["tgiann-bank"]:GetGangAccountBalance(society)
|
||||
end
|
||||
end,
|
||||
chargeSociety =
|
||||
function(society, amount)
|
||||
if Jobs[society] then
|
||||
exports["tgiann-bank"]:RemoveJobMoney(society, amount)
|
||||
else
|
||||
exports["tgiann-bank"]:RemoveGangMoney(society, amount)
|
||||
end
|
||||
end,
|
||||
fundSociety =
|
||||
function(society, amount)
|
||||
if Jobs[society] then
|
||||
exports["tgiann-bank"]:AddJobMoney(society, amount)
|
||||
else
|
||||
exports["tgiann-bank"]:AddGangMoney(society, amount)
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -134,7 +144,8 @@ function getSocietyAccount(society)
|
||||
local amount = 0
|
||||
if society == nil or society == "none" then return amount end
|
||||
|
||||
for _, script in pairs(societyFunc) do
|
||||
for i = 1, #societyFunc do
|
||||
local script = societyFunc[i]
|
||||
if isStarted(script.bankName) then
|
||||
local amount = script.getAccount(society)
|
||||
debugPrint("^6Bridge^7: ^3"..script.bankName.."^7: ^2Retrieved account ^7'^6"..society.."^7' ($"..tostring(amount)..")")
|
||||
@@ -156,7 +167,8 @@ end
|
||||
--- ```
|
||||
function chargeSociety(society, amount)
|
||||
|
||||
for _, script in pairs(societyFunc) do
|
||||
for i = 1, #societyFunc do
|
||||
local script = societyFunc[i]
|
||||
if isStarted(script.bankName) then
|
||||
script.chargeSociety(society, amount)
|
||||
local newAmount = getSocietyAccount(society)
|
||||
@@ -177,7 +189,8 @@ end
|
||||
--- ```
|
||||
function fundSociety(society, amount)
|
||||
|
||||
for _, script in pairs(societyFunc) do
|
||||
for i = 1, #societyFunc do
|
||||
local script = societyFunc[i]
|
||||
if isStarted(script.bankName) then
|
||||
script.fundSociety(society, amount)
|
||||
local newAmount = getSocietyAccount(society)
|
||||
|
||||
Reference in New Issue
Block a user