Skip to content

Commit 62e6a6f

Browse files
authored
Update functions.lua
Fixed a bug that prevented paychecks from working forever once 0 players was hit which typically directly happens on server start.
1 parent 7c4ef61 commit 62e6a6f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/functions.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,10 @@ function QBCore.Functions.CreateVehicle(source, model, vehtype, coords, warp)
395395
end
396396

397397
function PaycheckInterval()
398-
if not next(QBCore.Players) then return end
398+
if not next(QBCore.Players) then
399+
SetTimeout(QBCore.Config.Money.PayCheckTimeOut * (60 * 1000), PaycheckInterval) -- Prevent paychecks from stopping forever once 0 players
400+
return
401+
end
399402
for _, Player in pairs(QBCore.Players) do
400403
if not Player then return end
401404
local payment = QBShared.Jobs[Player.PlayerData.job.name]['grades'][tostring(Player.PlayerData.job.grade.level)].payment

0 commit comments

Comments
 (0)