Fixed sending message to offline player (desc)

- Fixed sending a message to offline players when they get promoted, fired or whatever.
- Improved translation
    - fixed hardcoded message
    - improved translation with the usage of formatting
This commit is contained in:
ElPumpo
2018-04-08 23:51:21 +02:00
parent 280e6845d8
commit 2a60ff3f1f
5 changed files with 47 additions and 47 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
Config = {}
Config.Locale = 'fr'
Config.EnableESXIdentity = false
Config.MaxSalary = 3500
Config.MaxSalary = 3500
+4 -4
View File
@@ -8,8 +8,8 @@ Locales['en'] = {
['employee_management'] = 'employee management',
['fire'] = 'fire',
['grade'] = 'grade',
['have_deposited'] = 'you have deposited ~r~$',
['have_withdrawn'] = 'you have withdrawn ~g~$',
['have_deposited'] = 'you have deposited ~r~$%s~s~',
['have_withdrawn'] = 'you have withdrawn ~g~$%s~s~',
['invalid_amount'] = 'invalid amount',
['invalid_amount'] = 'invalid amount',
['no'] = 'no',
@@ -24,8 +24,8 @@ Locales['en'] = {
['withdraw_amount'] = 'witdraw amount',
['withdraw_society_money'] = 'withdraw society money',
['yes'] = 'yes',
['you_have'] = 'you have ~g~$',
['you_have_laundered'] = 'you have ~r~laundered~s~ your money: ~g~$',
['you_have'] = 'you have ~g~%s$~s~ waiting in ~y~money laundering~s~ (24h).',
['you_have_laundered'] = 'you have ~r~laundered~s~ your money: ~g~$%s~s~',
['you_have_hired'] = 'you have recruited %s',
['you_have_been_hired'] = 'you have been hired by %s',
['you_have_fired'] = 'you have fired %s',
+5 -5
View File
@@ -2,14 +2,14 @@ Locales['fr'] = {
['actions'] = 'actions',
['deposit_amount'] = 'montant du dépôt',
['deposit_society_money'] = 'déposer argent société',
['do_you_want_to_recruit'] = 'Voulez-vous recruter %s ?',
['do_you_want_to_recruit'] = 'Voulez-vous recruter %s?',
['employee'] = 'employé',
['employee_list'] = 'liste des employés',
['employee_management'] = 'gestion employés',
['fire'] = 'licencier',
['grade'] = 'grade',
['have_deposited'] = 'vous avez déposé ~r~$',
['have_withdrawn'] = 'vous avez retiré ~g~$',
['have_deposited'] = 'vous avez déposé ~r~$%s~s~',
['have_withdrawn'] = 'vous avez retiré ~g~$%s~s~',
['invalid_amount'] = 'montant invalide',
['invalid_amount'] = 'montant invalide',
['no'] = 'non',
@@ -24,8 +24,8 @@ Locales['fr'] = {
['withdraw_amount'] = 'montant du retrait',
['withdraw_society_money'] = 'retirer argent société',
['yes'] = 'oui',
['you_have'] = 'vous avez ~g~$',
['you_have_laundered'] = 'vous avez ~r~blanchi~s~ votre argent : ~g~$',
['you_have'] = 'vous avez ~g~$%s~s~ en attente de ~r~blanchiement~s~ (24h).',
['you_have_laundered'] = 'vous avez ~r~blanchi~s~ votre argent : ~g~$%s~s~',
['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',
+9 -9
View File
@@ -8,8 +8,8 @@ Locales['sv'] = {
['employee_management'] = 'medarbetarhantering',
['fire'] = 'sparka',
['grade'] = 'grade',
['have_deposited'] = 'du har satt in ~r~$',
['have_withdrawn'] = 'du har tagit ut ~g~$',
['have_deposited'] = 'du har satt in ~r~$%s~s~',
['have_withdrawn'] = 'du har tagit ut ~g~$%s~s~',
['invalid_amount'] = 'Ogiltigt belopp',
['invalid_amount'] = 'Ogiltigt belopp',
['no'] = 'nej',
@@ -24,12 +24,12 @@ Locales['sv'] = {
['withdraw_amount'] = 'Ta ut summan',
['withdraw_society_money'] = 'ta ut samhällspengar',
['yes'] = 'ja',
['you_have'] = 'du har ~g~$',
['you_have_laundered'] = 'du har ~r~tvättat~s~ dina pengar: ~g~$',
['you_have_hired'] = 'du har anställt %s',
['you_have'] = 'du har ~g~%s$~s~ som väntar på ~y~pengartvätt~s~ (24h).',
['you_have_laundered'] = 'du har ~r~tvättat~s~ dina pengar: ~g~$%s~s~',
['you_have_hired'] = 'du har anställt ~y~%s~s~',
['you_have_been_hired'] = 'du har blivit anställd utav %s',
['you_have_fired'] = 'du har blivit sparkad %s',
['you_have_been_fired'] = 'du har blivit sparkad utav %s',
['you_have_promoted'] = 'du har blivit befodrad %s som %s',
['you_have_been_promoted'] = 'du har blivit befodrad',
['you_have_fired'] = 'du har ~r~sparkat~s~ ~y~%s~s~',
['you_have_been_fired'] = 'du har blivit ~r~sparkad~s~ utav ~y~%s~s~',
['you_have_promoted'] = 'du har befodrat ~y~%s~s~ till ~b~%s~s~',
['you_have_been_promoted'] = 'du har blivit ~b~befodrad~s~',
}
+28 -28
View File
@@ -89,7 +89,7 @@ AddEventHandler('esx_society:withdrawMoney', function(society, amount)
account.removeMoney(amount)
xPlayer.addMoney(amount)
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. amount)
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn', amount))
else
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('invalid_amount'))
@@ -112,7 +112,7 @@ AddEventHandler('esx_society:depositMoney', function(society, amount)
account.addMoney(amount)
end)
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_deposited') .. amount)
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_deposited', amount))
else
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('invalid_amount'))
@@ -138,7 +138,7 @@ AddEventHandler('esx_society:washMoney', function(society, amount)
['@amount'] = amount
},
function(rowsChanged)
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_have') .. amount .. '~s~ en attente de ~r~blanchiement~s~ (24h)')
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_have', amount))
end
)
@@ -210,7 +210,7 @@ ESX.RegisterServerCallback('esx_society:getEmployees', function(source, cb, soci
for i=1, #results, 1 do
table.insert(employees, {
name = results[i].firstname .. ' ' .. results[i].lastname,
name = results[i].firstname .. ' ' .. results[i].lastname,
identifier = results[i].identifier,
job = {
name = results[i].job,
@@ -274,31 +274,31 @@ end)
ESX.RegisterServerCallback('esx_society:setJob', function(source, cb, identifier, job, grade, type)
local xPlayer = ESX.GetPlayerFromIdentifier(identifier)
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)
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
end
if xPlayer ~= nil then
xPlayer.setJob(job, grade)
end
MySQL.Async.execute(
'UPDATE users SET job = @job, job_grade = @job_grade WHERE identifier = @identifier',
{
['@job'] = job,
['@job_grade'] = grade,
['@identifier'] = identifier
},
function(rowsChanged)
cb()
end
)
MySQL.Async.execute(
'UPDATE users SET job = @job, job_grade = @job_grade WHERE identifier = @identifier',
{
['@job'] = job,
['@job_grade'] = grade,
['@identifier'] = identifier
},
function(rowsChanged)
cb()
end
)
end)
@@ -394,7 +394,7 @@ function WashMoneyCRON(d, h, m)
end)
if foundPlayer then
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_have_laundered') .. result[i].amount)
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_have_laundered', result[i].amount))
end
MySQL.Async.execute(