Server

isStaff

Check if a player is part of the staff or not. If the player's staff returnGroup manages to return the group with the status or not

local result = exports.HRAdminMenu:isStaff(playerId: integer, returnGroup: boolean?): boolean, string?

doesGroupExist

Check if group exists

local result = exports.HRAdminMenu:doesGroupExist(group: string?): boolean

setStaff

Set someone as a staff member It returns 'playerFoundInStaff' if the player is already a staff member It returns 'invalidGroup' if the delivered staff group does not exist It returns 'idDoesNotExist' if the delivered player server Id does not exist

local result = exports.HRAdminMenu:setStaff(playerId: integer, group: string): 'playerFoundInStaff'|'invalidGroup'|'idDoesNotExist'?

removeStaff

Remove someone from the staff It returns the group if everything's fine and player is already not a part of the staff It returns 'playerIsNotStaff' if the player was not part of the staff in the time, the export was executed It returns 'idDoesNotExist' if the delivered player server Id does not exist

local result = exports.HRAdminMenu:removeStaff(playerId: integer): 'playerIsNotStaff'|'idDoesNotExist'|string

-- Example

local result = exports.HRAdminMenu:removeStaff(1)
if result == 'playerIsNotStaff' then
    HRLib.Notify(source, 'This player is not part of the staff!', 'error')
elseif result == 'idDoesNotExist' then
    HRLib.Notify(source, 'Invalid player server id!', 'error')
else
    HRLib.Notify(source, ('You successfully removed player %s from the staff with group %s'):format(1, result)
end

getPlayerGroup

Get someone's staff group

local result = exports.HRAdminMenu:getPlayerGroup(playerId: integer): string|'idDoesNotExist'?

getStaff

Get all the registered staff members

local result = exports.HRAdminMenu:getStaff(): table[]

--[[ Result format:
{
    {
        name = 'Henry', -- steam/fivem name
        steamHex = 'steam:00000',
        license = 'license:00000',
        discordId = 'discord:00000',
        group = 'mod'
    },
    {
        name = 'Ann',
        steamHex = 'steam:00000',
        license = 'license:00000',
        discordId = 'discord:00000',
        group = 'admin'
    }
}
]]

getActiveStaff

Get all the staff members in the server

local result = exports.HRAdminMenu:getActiveStaff(): table[]

--[[ Result format:
{
    {
        id = 1,
        name = 'Henry', -- steam/fivem name
        steamHex = 'steam:00000',
        license = 'license:00000',
        discordId = 'discord:00000',
        group = 'mod'
    },
    {
        id = 2,
        name = 'Ann',
        steamHex = 'steam:00000',
        license = 'license:00000',
        discordId = 'discord:00000',
        group = 'admin'
    }
}
]]

Last updated