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
  • Dispatch Event
  • Hacking Minigame
  • Vehicle Keys
  • Set Fuel
  • Notifications
  1. Guides
  2. Illegal Runs

Customization

  • There's some functions and events that you might need to customize the script and adapt it to your own server: dispatch, key system, notifications style, etc.

Dispatch Event

  • This event is triggered when the job vehicle enters a mission zone, the event receives the vehicle entity so you can use it with your own dispatch system:

client/framework/cops.lua
RegisterNetEvent("av_runs:sendDispatch", function(vehicle)
    -- Your dispatch event/export goes here:
    -- This example is only for ps-dispatch (make sure to read the docs first)
    if Config.Debug then
        print("Dispatch triggered")
    end
    if GetResourceState("ps-dispatch") ~= "missing" then
        exports['ps-dispatch']:VehicleShooting(vehicle)
    end
end)

Hacking Minigame

  • This minigame is activated when the driver uses the hacking device while inside the job vehicle. Ensure that it returns true or false, and most importantly, make sure your minigame export is async (otherwise, implement your own await mechanism)

client/framework/minigame.lua
function hackingMinigame()
    local result = true
    if GetResourceState('bl_ui') == "started" then
        result = exports.bl_ui:PrintLock(3, {
            grid = 4,
            duration = 20000,
            target = 4
        })
    end
    return result
end

Vehicle Keys

  • Once the vehicle is hacked and the driver has full control of it, this function is triggered so you can add your own vehicle keys export/event and give the vehicle keys to the player:

client/framework/functions.lua
function GiveKeys(vehicle) -- Just in case u need the vehicle object
    local plates = GetVehicleNumberPlateText(vehicle)
    -- Give vehicle keys export/event:
end

Set Fuel

  • The job vehicle is spawned with some random fuel set by the server, use your own export to add more:

client/framework/functions.lua
function SetFuel(vehicle)
    -- Add your own fuel export/event here:
    
end

Notifications

  • The script uses the ox_lib notifications:

client/framework/notifications.lua
RegisterNetEvent("av_runs:notification", function(title, description, type)
    lib.notify({
        title = title,
        description = description,
        type = type
    })
end)

Last updated 7 months ago