Closed JeiggerCreations closed 1 year ago
the line causing the error is this if Player.PlayerData.job and payment > 0 and (QBShared.Jobs[Player.PlayerData.job.name].offDutyPay or Player.PlayerData.job.onduty) then
What did you put for the offDutyPay
for your job?
Look in qb-core / shared / jobs.lua
It’s happened with offdutypay set true, I wasn’t sure if that was the problem or not
I'll test this and confirm, thanks
This issue has had 60 days of inactivity & will close within 7 days
Summary
after update to latest core, error on player join
Reproduction
-- Paychecks (standalone - don't touch) function PaycheckInterval() if next(QBCore.Players) then for _, Player in pairs(QBCore.Players) do if Player then local payment = QBShared.Jobs[Player.PlayerData.job.name]['grades'][tostring(Player.PlayerData.job.grade.level)].payment if not payment then payment = Player.PlayerData.job.payment end if Player.PlayerData.job and payment > 0 and (QBShared.Jobs[Player.PlayerData.job.name].offDutyPay or Player.PlayerData.job.onduty) then if QBCore.Config.Money.PayCheckSociety then local account = exports['qb-management']:GetAccount(Player.PlayerData.job.name) if account ~= 0 then -- Checks if player is employed by a society if account < payment then -- Checks if company has enough money to pay society TriggerClientEvent('QBCore:Notify', Player.PlayerData.source, Lang:t('error.company_too_poor'), 'error') else Player.Functions.AddMoney('bank', payment) exports['qb-management']:RemoveMoney(Player.PlayerData.job.name, payment) TriggerClientEvent('QBCore:Notify', Player.PlayerData.source, Lang:t('info.received_paycheck', {value = payment})) end else Player.Functions.AddMoney('bank', payment) TriggerClientEvent('QBCore:Notify', Player.PlayerData.source, Lang:t('info.received_paycheck', {value = payment})) end else Player.Functions.AddMoney('bank', payment) TriggerClientEvent('QBCore:Notify', Player.PlayerData.source, Lang:t('info.received_paycheck', {value = payment})) end end end end end SetTimeout(QBCore.Config.Money.PayCheckTimeOut (60 1000), PaycheckInterval) end
Expected behavior
no error for function PaycheckInterval and a functioning paycheck for players
Actual behavior
after error no paycheck function was non existent
Additional context
Last Updated
last week
Custom Resources
no
Resource Rename
no