mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 10:18:54 +00:00
remove duty system (unused code)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -294,7 +294,6 @@ function ESX.RefreshJobs()
|
||||
grade = 0,
|
||||
label = 'Unemployed',
|
||||
salary = 200,
|
||||
onDuty = false,
|
||||
skin_male = {},
|
||||
skin_female = {}
|
||||
}
|
||||
|
||||
@@ -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 = {}
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user