mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-09 08:03:56 +00:00
feat(server/interface): configurable txAdmin notifications override (#299)
This commit is contained in:
1 parent
361ce6cca6
commit
8a8700ca57
28 files changed
+201
-30
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user