mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-30 01:38:56 +00:00
refacotr(server/functions): Optimise PaycheckLoop function
This commit is contained in:
@@ -110,9 +110,9 @@ end
|
||||
-- Paychecks (standalone - don't touch)
|
||||
|
||||
function PaycheckLoop()
|
||||
local Players = QBCore.Functions.GetPlayers()
|
||||
local Players = QBCore.Players
|
||||
for i = 1, #Players, 1 do
|
||||
local Player = QBCore.Functions.GetPlayer(Players[i])
|
||||
local Player = Players[i]
|
||||
if Player.PlayerData.job and Player.PlayerData.job.onduty and Player.PlayerData.job.payment > 0 then
|
||||
Player.Functions.AddMoney('bank', Player.PlayerData.job.payment)
|
||||
TriggerClientEvent('QBCore:Notify', Players[i], 'You received your paycheck of $' .. Player.PlayerData.job.payment)
|
||||
|
||||
Reference in New Issue
Block a user