AV Scripts
StoreDiscord
  • Documentation
  • Guides
    • Dealerships
      • Installation
      • Admin Panel
        • All Vehicles
        • Dealerships
        • Auctions
      • Dealership Panel
        • Overview
        • Auctions
        • Employees
        • Orders
        • Payments
        • Showroom
        • Warehouse
        • Pre Owned
        • Settings
      • Buy/Sell Vehicles
      • Catalogue
      • Exports
      • FAQ
    • House Robbery
      • Installation
      • Add Shells
      • Dispatch
      • Exports
      • Weather
      • Minigames
      • Notifications
      • New Houses
      • Object Types
      • Sell Items
    • Illegal Runs
      • Installation
      • Customization
      • Ox Inventory
      • QB Inventory
    • Multicharacter
      • Installation
      • Character Slots
      • Clothes
      • Scenes
        • Previews
      • Exports
      • Weather
    • Paleto Heist
      • Buy here
    • Refund System
      • Installation
        • Inventories
    • Tuning Script
      • Installation
      • Events and Controls
      • Exports
      • Price Multiplier
    • Vehicleshop
      • Installation
      • Admin Panel
      • Addon Vehicles
      • Functions
        • Fuel
        • Keys
        • VIP
        • Weather
      • Garages
      • HUD
      • Society
    • Weather Script
      • Installation
      • Breath Condensation
      • Fog
      • Real Time Sync
      • Exports
    • VIP Script
      • Installation
      • Exports
      • Categories
      • Admin
      • Tebex
      • Free Tokens
  • LAPTOP PACK V3
    • Laptop v3
      • Installation
        • Inventory
        • Cosmo
        • Permissions
        • QBCore
        • Custom Framework/Inventory
        • Phone
        • Translate
      • Browser
      • Terminal
      • Documents
      • APPs Config
      • Exports
    • Boosting
      • Create Profile
      • APP
      • Contracts
      • Dispatch
      • Lockpick Export
      • VIN Export
    • Business
      • Installation
        • Inventories
          • Origen Inventory
            • ESX
            • QBCore
          • OX Inventory
          • QB/PS/LJ Inventory
          • Quasar Inventory
            • ESX
            • QBCore
          • Codem Inventory
          • Tgiann Inventory
        • ESX
      • Admin Panel
        • Create Zones
        • Edit Zones
      • Config
        • Animations
        • Blips
        • Buttons
        • Crafting
        • Effects
        • Events
          • Items
          • Zones
        • Logs
          • Custom Logs
        • Permissions
      • Exports
      • Banking Scripts
      • Multijobs
    • Cameras
      • Installation
        • Vehicle Cameras
      • Place Camera
      • Job Cameras
    • Drugs
      • Installation
      • Admin Panel
      • APP
      • Tables
      • Labs
        • PC
        • Raids
      • Alert Cops
      • Shells
      • Exports
    • Gangs
      • Installation
      • Admin Panel
        • Gangs
        • Whitelist
      • Properties
      • Register Gang
      • APP
        • Members
        • Settings
        • Missions
        • Blackmarket
        • Properties
      • Graffitis
      • Missions
      • Gang NPC
      • Shells
      • Exports
      • Labs
    • Groups
      • Events
      • Exports
    • Music
      • Installation
      • Music Labels
      • APP
        • Search Music
        • Playlists
        • Headphones
      • CDs
    • Racing
      • Installation
        • Permissions
        • Discord Logs
        • Addon Vehicles
      • Admin Panel
      • Categories
      • Events
      • Exports
      • Personal Settings
      • The Underground
    • Custom APPs
    • Discord Support
Powered by GitBook
On this page
  • Custom Permissions
  • Get Player Permissions
  1. LAPTOP PACK V3
  2. Business
  3. Config

Permissions

  • By default there's some permissions that can't be removed, those are used for Business APP and if you remove them it won't show any tab, this default permissions are:

Config.Permissions = {
    -- value: string, label: string, jobs: false or table with jobs who can access this permission
    { value = "employees",    label = "Employees", jobs = false }, -- Used for App (don't edit value field)
    { value = "menu",         label = "Menu", jobs = false  }, -- Used for App (don't edit value field)
    { value = "bank",         label = "Bank", jobs = false  }, -- Used for App (don't edit value field)
    { value = "applications", label = "Applications", jobs = false  }, -- Used for App (don't edit value field)
    { value = "stashes",      label = "Stashes", jobs = false  }, -- Gives access to business stashes
}

Employees: Players with this permission will be able to access the Employees tab and all its features (hire/fire players, send bonus, edit employees, etc)

Menu: Gives access to the Menu tab where players can register new items, edit or remove them. If the business is blacklisted the permission will be ignored.

Bank: This permission gives access to see the available funds in the overview tab and add/remove funds from the bank tab.

Applications: Gives access to the applications tab where you can see the job applications.

Stahes: Required to access the default stashes zones for the business.

Custom Permissions

  • For this example we are gonna create a new permission named Evidence Stash which is gonna be available only for police and bcso jobs:

Config.Permissions = {
    -- value: string, label: string, jobs: false or table with jobs who can access this permission
    { value = "employees",    label = "Employees", jobs = false }, -- Used for App (don't edit value field)
    { value = "menu",         label = "Menu", jobs = false  }, -- Used for App (don't edit value field)
    { value = "bank",         label = "Bank", jobs = false  }, -- Used for App (don't edit value field)
    { value = "applications", label = "Applications", jobs = false  }, -- Used for App (don't edit value field)
    { value = "stashes",      label = "Stashes", jobs = false  }, -- Gives access to business stashes
    { value = "evidence_stash", label = "Evidence Stash", jobs = {"police", "bcso"}  }, -- Gives access to evidence stashes / this is just an example of a custom permission
}
  • Once the permission is added the business owner will be able to assign it to his employees using the Employees Tab in Business APP

Get Player Permissions

  • You can use the following export client/server side to retrieve the player permissions:

Client Side:

-- Client side doesn't need to send source or any argument
local permissions = exports['av_business']:getPermissions()

Server Side:

-- source:number required
-- job:string optional
local permissions = exports['av_business']:getPermissions(source,job)

Both exports will return a table with the player permissions, this is an example on how it can looks like:

local permissions = exports['av_business']:getPermissions()
print(json.encode(permissions))
-- the table can look something like this, 
-- depending on your actual character permissions it can have more or less:
--[[
    {
        "applications": true,
        "bank": true,
        "evidence": true,
        "isBoss": true,
        "evidence_stash": true,
    }
]]--

You can find a better example in Zones

Last updated 11 months ago