This script, you can immerse the Roleplay Experience for your Players to Force them to collect their PayChecks from the Collection Points, this can be added to any job or Paycheck system of QBCore or QBOX. Comprehensive installation and feature instructions are provided in the README.
- Force Players to collect their Paychecks from the Collection Points.
- Add this to any Job or Paycheck System.
- Easy to use and simple code.
- Easy to integrate with any job system.
- Utilized the Character MetaData system.
- No SQL Creation to import and Better Server Performance.
- Utilizes ox_lib and ox_target.
- Optimized and Clean Code.
- Creates Logs for the Paychecks.
- Supports BC_ProgressStage
- Download the script.
- Add the script to your resources folder.
- Open the script and configure the
config.lua
file. - Follow the Steps provided in
Integration
Section. - Add
ensure BC_Paycheck
to your server.cfg file. - Restart your server.
Can be integrated with any Job or Paycheck System, just replace the Export with your Job or Paycheck System Export.
exports.BC_Paycheck:addPaycheck(source, amount, reason)
Search for PlayerData.metadata['hunger'] = PlayerData.metadata['hunger'] or 100
this line in for QBCore: qb-core/server/player.lua
and just add this below it
PlayerData.metadata['paycheck'] = PlayerData.metadata['paycheck'] or 0
Search for playerData.metadata.hunger = playerData.metadata.hunger or 100
this line in for QBOX: qbx_core/server/player.lua
and just add this below it
playerData.metadata.paycheck = playerData.metadata.paycheck or 0
Find the PaycheckInterval()
function in qb-core/server/functions.lua
and replace it with the following code:
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-banking']:GetAccountBalance(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
exports.BC_Paycheck:addPaycheck(Player.PlayerData.source, payment, Player.PlayerData.job.name..' Paycheck') -- BC_Paycheck Replace Export
exports['qb-banking']:RemoveMoney(Player.PlayerData.job.name, payment, 'Employee Paycheck')
TriggerClientEvent('QBCore:Notify', Player.PlayerData.source, Lang:t('info.received_paycheck', { value = payment }))
end
else
exports.BC_Paycheck:addPaycheck(Player.PlayerData.source, payment, Player.PlayerData.job.name .. ' Paycheck') -- BC_Paycheck Replace Export
TriggerClientEvent('QBCore:Notify', Player.PlayerData.source, Lang:t('info.received_paycheck', { value = payment }))
end
else
exports.BC_Paycheck:addPaycheck(Player.PlayerData.source, payment, Player.PlayerData.job.name .. ' Paycheck') -- BC_Paycheck Replace Export
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
Add it in your qb-smallresources/server/logs.lua
file.
['paycheck'] = '',
If you need any help, feel free to join my Discord Server and write your issues in the support channel.
This project is licensed under the GPL-3.0 License.