Installing for Standalone

If you're using a standalone framework, you'll need to configure the Cfg.GetAdminGroup function to correctly retrieve the player's permission levels based on your own framework. Use the following configuration:

Cfg.WhitelistedGroups = { 
    -- Change with your framework's admin groups
    [2] = true,
    [3] = true,
    [4] = true,
    [5] = true
}

Cfg.GetAdminGroup = function(source) 
    if source == nil then return 0 end
    if source == 0 then return 5 end
    
    -- You should use exports to get the player permission
    return exports["core"]:GetPlayerPerm(source)
end

This setup ensures that the player's permission level is fetched correctly, allowing ZeroTrust to verify admin access. You should replace "core" and GetPlayerPerm(source) with your framework's appropriate export and permission check.

To avoid excessive calls to the export function and improve server performance, ZeroTrust caches the result of Cfg.GetAdminGroup after the first use per player. This ensures that each player's admin group is checked only once, minimizing unnecessary export calls and avoiding potential spam.

Last updated