|
|
|
|
@@ -70,14 +70,14 @@ 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.RenewedBanking then TriggerEvent("qb-bossmenu:server:removeAccountMoney", tostring(Player.PlayerData.job.name), amount)
|
|
|
|
|
else exports["qb-management"]: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.RenewedBanking then TriggerEvent("qb-bossmenu:server:addAccountMoney", tostring(Player.PlayerData.job.name), amount)
|
|
|
|
|
else exports["qb-management"]: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 +100,8 @@ 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.RenewedBanking then TriggerEvent("qb-bossmenu:server:removeAccountMoney", tostring(Player.PlayerData.job.name), amount)
|
|
|
|
|
else exports["qb-management"]: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 +122,14 @@ 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.RenewedBanking then TriggerEvent("qb-gangmenu:server:removeAccountMoney", tostring(Player.PlayerData.gang.name), amount)
|
|
|
|
|
else exports["qb-management"]: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.RenewedBanking then TriggerEvent("qb-gangmenu:server:addAccountMoney", tostring(Player.PlayerData.gang.name), amount)
|
|
|
|
|
else exports["qb-management"]: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 +152,8 @@ 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.RenewedBanking then TriggerEvent("qb-bossmenu:server:removeAccountMoney", tostring(Player.PlayerData.gang.name), amount)
|
|
|
|
|
else exports["qb-management"]: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)
|
|
|
|
|
@@ -213,7 +213,7 @@ QBCore.Functions.CreateCallback('jim-payments:ATM:Find', function(source, cb)
|
|
|
|
|
local gsociety = 0
|
|
|
|
|
|
|
|
|
|
-- If qb-management, grab info directly from database
|
|
|
|
|
if Config.Manage then
|
|
|
|
|
if Config.RenewedBanking 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 +267,4 @@ RegisterServerEvent("jim-payments:server:ATM:give", function(citizen, price)
|
|
|
|
|
end
|
|
|
|
|
else triggerNotify(nil, Loc[Config.Lan].error["zero"], 'error', source) end
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|