From 62e6a6f949da1483e7222de085e9f389732b2f35 Mon Sep 17 00:00:00 2001 From: Miguel Oppermann Date: Sun, 2 Mar 2025 00:42:27 +0100 Subject: [PATCH] Update functions.lua Fixed a bug that prevented paychecks from working forever once 0 players was hit which typically directly happens on server start. --- server/functions.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/functions.lua b/server/functions.lua index 8f81093..ba08307 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -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