mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Improved cron code and readme
This commit is contained in:
+2
-11
@@ -68,21 +68,12 @@ function CalculateBankSavings (d, h, m)
|
||||
{ ['@account_name'] = 'bank_savings' },
|
||||
function (result)
|
||||
local bankInterests = 0
|
||||
local xPlayers = ESX.GetPlayers()
|
||||
|
||||
for i=1, #result, 1 do
|
||||
local foundPlayer = false
|
||||
local xPlayer = nil
|
||||
local xPlayer = ESX.GetPlayerFromIdentifier(result[i].owner)
|
||||
|
||||
for i=1, #xPlayers, 1 do
|
||||
local xPlayer2 = ESX.GetPlayerFromId(xPlayers[i])
|
||||
if xPlayer2.identifier == result[i].owner then
|
||||
foundPlayer = true
|
||||
xPlayer = xPlayer2
|
||||
end
|
||||
end
|
||||
|
||||
if foundPlayer then
|
||||
if xPlayer ~= nil then
|
||||
TriggerEvent('esx_addonaccount:getAccount', 'bank_savings', xPlayer.identifier, function (account)
|
||||
local interests = math.floor(account.money / 100 * Config.BankSavingPercentage)
|
||||
bankInterests = bankInterests + interests
|
||||
|
||||
Reference in New Issue
Block a user