Skip to content

Commit

Permalink
Merge pull request #139 from Z3rio/main
Browse files Browse the repository at this point in the history
feat: auto create accounts for jobs
  • Loading branch information
GhzGarage authored Oct 25, 2024
2 parents 0e47de4 + b2b1a73 commit 3bc00be
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,16 @@ end)

CreateThread(function()
local accounts = MySQL.query.await('SELECT * FROM bank_accounts')

for _, account in ipairs(accounts) do
Accounts[account.account_name] = account
end

for job in pairs(QBCore.Shared.Jobs) do
if Accounts[job] == nil then
CreateJobAccount(job, 0)
end
end
end)

CreateThread(function()
Expand Down

0 comments on commit 3bc00be

Please sign in to comment.