If you want to add an option to set admin duty by player ID (the player must have the necessary permissions to be assigned admin duty), you can create a new file in the server/lib folder. You can name the file, for example, customAdminDuty.lua, or anything else you prefer.
In this file, add two server-side events that can be triggered to enable admin duty for a specified player by their ID.
If you also want to add commands for that, you can include them below the events. Do not forget to rename the commands.
RegisterCommand('COMMAND_TO_TOGGLE_DUTY_FOR_ADMIN_ON', function(source,args)local playerId =tonumber(args[1])-- Check for the permissions required to use this command here.ifnothasAdminPermissions(source) thensendNotification(source, 'You don\'t have permissions to use this command.')returnend-- Checks if playerId is usedifnot playerId thensendNotification(source, 'You need to specify the player\'s ID for this command.')returnend-- Checks if player existifnotGetPlayerName(playerId) thensendNotification(source, 'The player with the specified ID is not online.')returnend-- Check for the permissions of the selected player.ifnothasAdminPermissions(playerId) thensendNotification(source, 'The player with the specified ID does not have admin permissions.')returnendTriggerEvent('rcore_report:server_setAdminDutyOn', playerId)end)RegisterCommand('COMMAND_TO_TOGGLE_DUTY_FOR_ADMIN_OFF', function(source,args)local playerId =tonumber(args[1])-- Check for the permissions required to use this command here.ifnothasAdminPermissions(source) thensendNotification(source, 'You don\'t have permissions to use this command.')returnend-- Checks if playerId is usedifnot playerId thensendNotification(source, 'You need to specify the player\'s ID for this command.')returnend-- Checks if player existifnotGetPlayerName(playerId) thensendNotification(source, 'The player with the specified ID is not online.')returnend-- Check for the permissions of the selected player.ifnothasAdminPermissions(playerId) thensendNotification(source, 'The player with the specified ID does not have admin permissions.')returnendTriggerEvent('rcore_report:server_setAdminDutyOff', playerId)end)