Permissions

Instead of a rank-based system, the gang system utilizes a specific permissions model. This gives you complete control to define exactly what each member can do.

Here's a list of default permissions:

  • members: Gives access to add/edit/remove gang members.

  • missions: Gives access to view and start missions in the gang app.

  • properties: Gives access to view properties and start lab process, only boss can resell a property.

  • market: Gives access to Market tab in Gangs App and buy any property for the gang.

Custom Permissions

If you need custom permissions you can simply go to config/_permissions.lua and add it to Config.Permissions table.

Config.Permissions = {
    {value = "members", label = "Members"}, --gives access to manage members in APP
    {value = "missions", label = "Missions"}, --gives access to missions tab in APP
    {value = "properties", label = "Properties"}, --gives access to properties tab in APP
    {value = "market", label = "Market"}, --gives access to black market tab in APP
    -- EXAMPLE OF NEW PERMISSION
    {value = "crafting", label = "Crafting Bench"},
}

Check permissions

In your own script you can use the export getPermissions() to retrieve the player gang permissions and run your own check, this is just an EXAMPLE for a crafting table:

RegisterNetEvent('some_script:openTable', function()
    local gangPermissions = exports['av_gangs']:getPermissions()
    if not gangPermissions then return end -- Not a gang member
    if not gangPermissions['crafting'] then -- Player doesn't have crafting permission
        TriggerEvent('av_laptop:notification', 'Table', "You don't have permissions", "error")
        return
    end
    -- Some random code here:
end

Last updated