txAdmin sends server events to allow for integration of some functionalities with other resources. The event name will be txAdmin:events:<name> and the first (and only) parameter will be a table that may contain relevant data.
Important:
Do not fully rely on events where consistency is key since they may be executed while the server is not online; therefore, your resource would not be notified about it. For instance, while the server is stopped one could whitelist or ban player identifiers.
Broadcasted automatically [30, 15, 10, 5, 4, 3, 2, 1] minutes before a scheduled restart. Can be used with the convar txAdmin-hideDefaultScheduledRestartWarning to display a custom warning notification.
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
AddEventHandler('txAdmin:events:scheduledRestart', function(eventData)
if eventData.secondsRemaining == 60 then
CreateThread(function()
Wait(45000)
print("15 seconds before restart... saving all players!")
ESX.SavePlayers(function()
-- do something
end)
end)
end
end)Broadcasted when a player is kicked using txAdmin.
Broadcasted when an announcement is made using txAdmin. Can be used with the convar txAdmin-hideDefaultAnnouncement to display custom announcement notifications.
txAdmin.Broadcasted whenever an admin is authenticated in-game or loses admin permissions. This event is particularly useful for anti-cheats to ignore txAdmin admins.
-1 when revoking the permission of all admins (forced reauth).