diff --git a/client/main.lua b/client/main.lua index ae3cf641..e45ab7d0 100644 --- a/client/main.lua +++ b/client/main.lua @@ -242,9 +242,11 @@ function OpenEmployeeList(society) if data.value == 'fire' then + TriggerEvent('esx:showNotification', _U('you_have_fired', employee.name)) + ESX.TriggerServerCallback('esx_society:setJob', function() OpenEmployeeList(society) - end, employee.identifier, 'unemployed', 0) + end, employee.identifier, 'unemployed', 0, 'fire') end @@ -294,9 +296,11 @@ function OpenRecruitMenu(society) if data2.current.value == 'yes' then + TriggerEvent('esx:showNotification', _U('you_have_hired', data.current.name)) + ESX.TriggerServerCallback('esx_society:setJob', function() OpenRecruitMenu(society) - end, data.current.identifier, society, 0) + end, data.current.identifier, society, 0, 'hire') end @@ -336,9 +340,11 @@ function OpenPromoteMenu(society, employee) function(data, menu) menu.close() + TriggerEvent('esx:showNotification', _U('you_have_promoted', employee.name, data.current.label)) + ESX.TriggerServerCallback('esx_society:setJob', function() OpenEmployeeList(society) - end, employee.identifier, society, data.current.value) + end, employee.identifier, society, data.current.value, promote) end, function(data, menu) diff --git a/locales/fr.lua b/locales/fr.lua index 1ab0af24..d017ad05 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -27,5 +27,11 @@ Locales['fr'] = { ['yes'] = 'oui', ['you_have'] = 'vous avez ~g~$', ['you_have_laundered'] = 'vous avez ~r~blanchi~s~ votre argent : ~g~$', + ['you_have_hired'] = 'Vous avez recruté %s', + ['you_have_been_hired'] = 'Vous avez été recruté dans la société %s', + ['you_have_fired'] = 'Vous avez viré %s', + ['you_have_been_fired'] = 'Vous avez été viré de la société %s', + ['you_have_promoted'] = 'Vous avez promu %s en tant que %s', + ['you_have_been_promoted'] = 'Vous avez été promu', } diff --git a/server/main.lua b/server/main.lua index 8ff83079..9460a9a0 100644 --- a/server/main.lua +++ b/server/main.lua @@ -149,10 +149,18 @@ ESX.RegisterServerCallback('esx_society:getJob', function(source, cb, society) end) -ESX.RegisterServerCallback('esx_society:setJob', function(source, cb, identifier, job, grade) +ESX.RegisterServerCallback('esx_society:setJob', function(source, cb, identifier, job, grade, type) local xPlayer = ESX.GetPlayerFromIdentifier(identifier) + if type == 'hire' then + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_have_been_hired', job)) + elseif type == 'promote' then + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_have_been_promoted')) + elseif type == 'fire' then + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_have_been_fired', xPlayer.getJob().label)) + end + if xPlayer ~= nil then xPlayer.setJob(job, grade) end