diff --git a/fxmanifest.lua b/fxmanifest.lua index e6fd7d25..f0c882fc 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -33,6 +33,7 @@ files { shared_script 'resource/init.lua' shared_scripts { + 'imports/locale/shared.lua', 'resource/**/shared.lua', -- 'resource/**/shared/*.lua' } @@ -49,6 +50,6 @@ client_scripts { server_scripts { 'imports/callback/server.lua', 'resource/**/server.lua', - -- 'resource/**/server/*.lua' + 'resource/**/server/*.lua', } diff --git a/locales/al.json b/locales/al.json index ee207c85..869acc03 100644 --- a/locales/al.json +++ b/locales/al.json @@ -5,5 +5,10 @@ "close": "Mbylle", "confirm": "Konfirmo", "more": "More..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/cs.json b/locales/cs.json index 614c3a5a..52c52d32 100644 --- a/locales/cs.json +++ b/locales/cs.json @@ -5,5 +5,10 @@ "close": "Zavřít", "confirm": "Potvrdit", "more": "Více..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/de.json b/locales/de.json index e6b82b10..6db70dc2 100644 --- a/locales/de.json +++ b/locales/de.json @@ -5,5 +5,10 @@ "close": "Schließen", "confirm": "Bestätigen", "more": "Mehr..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/en.json b/locales/en.json index 855d0f91..c35d631d 100644 --- a/locales/en.json +++ b/locales/en.json @@ -5,5 +5,10 @@ "close": "Close", "confirm": "Confirm", "more": "More..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/es.json b/locales/es.json index f3090948..0d1ce8f7 100644 --- a/locales/es.json +++ b/locales/es.json @@ -5,5 +5,10 @@ "close": "Cerrar", "confirm": "Confirmar", "more": "Más..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/et.json b/locales/et.json index 9e1f5f96..44cd582c 100644 --- a/locales/et.json +++ b/locales/et.json @@ -5,5 +5,10 @@ "close": "Sulge", "confirm": "Kinnita", "more": "Rohkem..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/fr.json b/locales/fr.json index e5031e2b..e03cd95a 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -5,5 +5,10 @@ "close": "Fermer", "confirm": "Confirmer", "more": "Plus..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/he.json b/locales/he.json index b7addbc9..bb463bd5 100644 --- a/locales/he.json +++ b/locales/he.json @@ -5,5 +5,10 @@ "close": "סגירה", "confirm": "אישור", "more": "...עוד" - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/hr.json b/locales/hr.json index 35654a95..e66dd8ba 100644 --- a/locales/hr.json +++ b/locales/hr.json @@ -5,5 +5,10 @@ "close": "Zatvori", "confirm": "Potvrdi", "more": "Više..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/hu.json b/locales/hu.json index 7e75b54b..32cec195 100644 --- a/locales/hu.json +++ b/locales/hu.json @@ -5,5 +5,10 @@ "close": "Bezárás", "confirm": "Megerősít", "more": "More..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/id.json b/locales/id.json index 7be40f53..c3748fbe 100644 --- a/locales/id.json +++ b/locales/id.json @@ -5,5 +5,10 @@ "close": "Tutup", "confirm": "Konfirmasi", "more": "More..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/it.json b/locales/it.json index 584b2f42..8f883b2a 100644 --- a/locales/it.json +++ b/locales/it.json @@ -2,8 +2,13 @@ "language": "Italiano", "ui": { "cancel": "Annulla", - "close": "Chiudere", - "confirm": "Confermare", - "more": "Di più..." - } + "close": "Chiudi", + "confirm": "Conferma", + "more": "Altro..." + }, + "txadmin_announcement": "Annuncio server da %s", + "txadmin_dm": "Messaggio diretto da %s", + "txadmin_warn": "Sei stato richiamato da %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Riavvio Programmato" } diff --git a/locales/lt.json b/locales/lt.json index 9e8e3cfb..ad6fc3e3 100644 --- a/locales/lt.json +++ b/locales/lt.json @@ -5,5 +5,10 @@ "close": "Uždaryti", "confirm": "Patvirtinti", "more": "Daugiau..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/nl.json b/locales/nl.json index 57e51530..cdec229d 100644 --- a/locales/nl.json +++ b/locales/nl.json @@ -5,5 +5,10 @@ "close": "Sluiten", "confirm": "Bevestig", "more": "More..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/no.json b/locales/no.json index f6299e5b..7dd39906 100644 --- a/locales/no.json +++ b/locales/no.json @@ -5,5 +5,10 @@ "close": "Lukk", "confirm": "Bekreft", "more": "Mer..." - } - } \ No newline at end of file + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" + } diff --git a/locales/pl.json b/locales/pl.json index 1fa58493..d235302f 100644 --- a/locales/pl.json +++ b/locales/pl.json @@ -5,5 +5,10 @@ "close": "Zamknij", "confirm": "Potwierdź", "more": "More..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/pt-br.json b/locales/pt-br.json index 14125d1b..2692c750 100644 --- a/locales/pt-br.json +++ b/locales/pt-br.json @@ -5,5 +5,10 @@ "close": "Fechar", "confirm": "Confirmar", "more": "Mais..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/ru.json b/locales/ru.json index e23aed42..751f888f 100644 --- a/locales/ru.json +++ b/locales/ru.json @@ -5,5 +5,10 @@ "close": "Закрыть", "confirm": "Подтвердить", "more": "Ещё..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/sk.json b/locales/sk.json index f4858805..59d7e4fe 100644 --- a/locales/sk.json +++ b/locales/sk.json @@ -5,5 +5,10 @@ "close": "Zavrieť", "confirm": "Potvrdiť", "more": "More..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/sl.json b/locales/sl.json index be0d2253..96d0c3de 100644 --- a/locales/sl.json +++ b/locales/sl.json @@ -5,5 +5,10 @@ "close": "Zapri", "confirm": "Potrdi", "more": "More..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/sv.json b/locales/sv.json index 65054175..4508a67b 100644 --- a/locales/sv.json +++ b/locales/sv.json @@ -5,5 +5,10 @@ "close": "Stäng", "confirm": "Acceptera", "more": "Mer..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/th.json b/locales/th.json index 972b811c..aa37dec8 100644 --- a/locales/th.json +++ b/locales/th.json @@ -5,5 +5,10 @@ "close": "ปิด", "confirm": "ยืนยัน", "more": "เพิ่มเติม..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/tr.json b/locales/tr.json index 3b86a46e..fc5328d8 100644 --- a/locales/tr.json +++ b/locales/tr.json @@ -5,5 +5,10 @@ "close": "Kapat", "confirm": "Onayla", "more": "Daha Fazla..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/zh-cn.json b/locales/zh-cn.json index 6d372ac8..27acbd82 100644 --- a/locales/zh-cn.json +++ b/locales/zh-cn.json @@ -5,5 +5,10 @@ "close": "关闭", "confirm": "确认", "more": "More..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/locales/zh-tw.json b/locales/zh-tw.json index e5483a9d..2eb767f8 100644 --- a/locales/zh-tw.json +++ b/locales/zh-tw.json @@ -5,5 +5,10 @@ "close": "關閉", "confirm": "確認", "more": "More..." - } + }, + "txadmin_announcement": "Server announcement by %s", + "txadmin_dm": "Direct Message from %s", + "txadmin_warn": "You have been warned by %s", + "txadmin_warn_content": "%s \nAction ID: %s", + "txadmin_scheduledrestart": "Scheduled Restart" } diff --git a/resource/interface/server/txadmin.lua b/resource/interface/server/txadmin.lua new file mode 100644 index 00000000..cff60f54 --- /dev/null +++ b/resource/interface/server/txadmin.lua @@ -0,0 +1,44 @@ +if GetConvarInt('ox:txAdminNotifications', false) then + if GetConvar('txAdmin-hideDefaultAnnouncement', 'false') == 'true' then + AddEventHandler('txAdmin:events:announcement', function(eventData) + TriggerClientEvent('ox_lib:notify', -1, { + id = 'txAdmin:announcement', + title = locale('txadmin_announcement', eventData.author), + description = eventData.message, + duration = 5000 + }) + end) + end + + if GetConvar('txAdmin-hideDefaultDirectMessage', 'false') == 'true' then + AddEventHandler('txAdmin:events:playerDirectMessage', function(eventData) + TriggerClientEvent('ox_lib:notify', eventData.target, { + id = 'txAdmin:playerDirectMessage', + title = locale('txadmin_dm', eventData.author), + description = eventData.message, + duration = 5000 + }) + end) + end + + if GetConvar('txAdmin-hideDefaultWarning', 'false') == 'true' then + AddEventHandler('txAdmin:events:playerWarned', function(eventData) + TriggerClientEvent('ox_lib:alertDialog', eventData.target, { + header = locale('txadmin_warn', eventData.author), + content = locale('txadmin_warn_content', eventData.reason, eventData.actionId), + centered = true + }) + end) + end + + if GetConvar('txAdmin-hideDefaultScheduledRestartWarning', 'false') == 'true' then + AddEventHandler('txAdmin:events:scheduledRestart', function(eventData) + TriggerClientEvent('ox_lib:notify', -1, { + id = 'txAdmin:scheduledRestart', + title = locale('txadmin_scheduledrestart'), + description = eventData.translatedMessage, + duration = 5000 + }) + end) + end +end diff --git a/resource/shared.lua b/resource/shared.lua new file mode 100644 index 00000000..aa9ba617 --- /dev/null +++ b/resource/shared.lua @@ -0,0 +1 @@ +lib.locale()