Server Groups

Server groups are pre-configured categories managed by administration. You can find and modify the list in server/editable/groups.lua.

Each group must follow this structure:

  • Group Key (string): The index key. A unique identifier for the group.

  • label (string): The display name shown to users with access in their App.

  • canAccess function(playerId): A function that must return true to grant the player access to the group, or false to hide it from them.

av_cameras/server/editable/groups.lua
Config.FixedGroups = {
    ["pacific_bank"] = { -- index key should be unique
        label = "Pacific Bank",
        canAccess = function(playerId)
            local hasAccess = false
            -- Add your own check here and set hasAccess to true if the player should have access to Pacific Bank cameras, for example:
            hasAccess = exports['av_laptop']:hasJob(playerId, {"police", "sheriff", "leo", "bsco"})
            -- Leave the rest of the code as is, it will print a debug message with the result
            dbug("Does player with server id "..tostring(playerId).." have access to bank cameras? "..tostring(hasAccess))
            return hasAccess
        end,
    },
}

Last updated