Update functions.lua

Fixed a bug that prevented paychecks from working forever once 0 players was hit which typically directly happens on server start.
This commit is contained in:
Miguel Oppermann
2025-03-02 00:42:27 +01:00
committed by GitHub
parent 7c4ef6130f
commit 62e6a6f949
+4 -1
View File
@@ -395,7 +395,10 @@ function QBCore.Functions.CreateVehicle(source, model, vehtype, coords, warp)
end
function PaycheckInterval()
if not next(QBCore.Players) then return end
if not next(QBCore.Players) then
SetTimeout(QBCore.Config.Money.PayCheckTimeOut * (60 * 1000), PaycheckInterval) -- Prevent paychecks from stopping forever once 0 players
return
end
for _, Player in pairs(QBCore.Players) do
if not Player then return end
local payment = QBShared.Jobs[Player.PlayerData.job.name]['grades'][tostring(Player.PlayerData.job.grade.level)].payment