Skip to content

Commit

Permalink
remove duty system (unused code)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mycroft-Studios committed Aug 30, 2022
1 parent a40eaf9 commit c00ff23
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 22 deletions.
1 change: 0 additions & 1 deletion [esx]/es_extended/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Config.NativeNotify = false -- use old native notification?
Config.Multichar = true -- Enable support for esx_multicharacter
Config.Identity = true -- Select a characters identity data before they have loaded in (this happens by default with multichar)
Config.DistanceGive = 4.0 -- Max distance when giving items, weapons etc.
Config.OnDuty = true -- Default state of the on duty system
Config.DisableHealthRegen = false -- Player will no longer regenerate health
Config.DisableVehicleRewards = true -- Disables Player Recieving weapons from vehicles
Config.DisableNPCDrops = true -- stops NPCs from dropping weapons on death
Expand Down
1 change: 0 additions & 1 deletion [esx]/es_extended/server/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ function ESX.RefreshJobs()
grade = 0,
label = 'Unemployed',
salary = 200,
onDuty = false,
skin_male = {},
skin_female = {}
}
Expand Down
17 changes: 0 additions & 17 deletions [esx]/es_extended/server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ function loadESXPlayer(identifier, playerId, isNew)
userData.job.grade_name = gradeObject.name
userData.job.grade_label = gradeObject.label
userData.job.grade_salary = gradeObject.salary
userData.job.onDuty = Config.OnDuty

userData.job.skin_male = {}
userData.job.skin_female = {}
Expand Down Expand Up @@ -678,19 +677,3 @@ AddEventHandler('txAdmin:events:serverShuttingDown', function()
Core.SavePlayers()
end)

RegisterNetEvent('esx:setDuty')
AddEventHandler('esx:setDuty', function(bool)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer.job.onDuty == bool then
return
end

if bool then
xPlayer.setDuty(true)
xPlayer.triggerEvent('esx:showNotification', _U('started_duty'))
else
xPlayer.setDuty(false)
xPlayer.triggerEvent('esx:showNotification', _U('stopped_duty'))
end
TriggerClientEvent('esx:setJob', xPlayer.source, xPlayer.job)
end)
5 changes: 2 additions & 3 deletions [esx]/es_extended/server/paycheck.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ function StartPayCheck()
for i=1, #(xPlayers) do
local xPlayer = xPlayers[i]
local job = xPlayer.job.grade_name
local onDuty = xPlayer.job.onDuty
local salary = xPlayer.job.grade_salary

if salary > 0 then
if job == 'unemployed' then -- unemployed
xPlayer.addAccountMoney('bank', salary)
TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), _U('received_paycheck'), _U('received_help', salary), 'CHAR_BANK_MAZE', 9)
elseif Config.EnableSocietyPayouts and onDuty then -- possibly a society
elseif Config.EnableSocietyPayouts then -- possibly a society
TriggerEvent('esx_society:getSociety', xPlayer.job.name, function (society)
if society ~= nil then -- verified society
TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function (account)
Expand All @@ -31,7 +30,7 @@ function StartPayCheck()
TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), _U('received_paycheck'), _U('received_salary', salary), 'CHAR_BANK_MAZE', 9)
end
end)
elseif onDuty then -- generic job
else -- generic job
xPlayer.addAccountMoney('bank', salary)
TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), _U('received_paycheck'), _U('received_salary', salary), 'CHAR_BANK_MAZE', 9)
end
Expand Down

0 comments on commit c00ff23

Please sign in to comment.