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
  • 1) CanCreateTracks()
  • 2) CanCreateRaces()
  • 3) CanDeleteTracks()
  • 4) AdminCrew()
  1. Laptop Pack
  2. AV Racing

Permissions

AV Racing uses 4 different functions to verify player permissions, go to server/framework/permissions.lua, you will find the following functions:

1) CanCreateTracks()

  • This function is used to retrieve the player permissions to access the Create Track button in Racing APP (the blue one from the Tracks tab).

2) CanCreateRaces()

  • This function is used to retrieve the player permissions to access the Create Race button. Players with this permission will be able to organize and start races.

3) CanDeleteTracks()

  • This function retrieves player permissions to access the Delete Track button. If a Track is deleted can't be recovered, all the checkpoints and leaderboard will be lost.

4) AdminCrew()

  • This function gives you access to the command /racing:crew where you can create and delete racing crews.

This 3 functions are pre configured to retrieve the player admin permissions, but you can modify every function and make it compatible with your custom checks like job, job grades, items, etc. Here is an example on how to add a check with item, if the Player have the golden_dongle it will return true:

function CanCreateTracks(src) -- Player can create new tracks
    local permission = false
    permission = exports['av_laptop']:hasItem(src,'golden_dongle')
    return permission
end

Or maybe you want to add manually the Players identifier to a table:

local allowed = { -- Table with the players citizenid/character identifier
    ['XDFGH1'] = true,
    ['ABC123'] = true,
}

function CanCreateRaces(src) -- Player can create new events (races)
    local permission = false
    local identifier = exports['av_laptop']:getIdentifier(src)
    if allowed[identifier] then
        permission = true
    end
    return permission
end

Last updated 1 year ago