JG Scripts Docs
DiscordSupportStore
  • Welcome!
  • Claim Purchase
  • FiveM Escrow Errors
  • Permissions Troubleshooting
  • Translations
  • ๐Ÿ› ๏ธMechanic
    • Introduction
    • Installation & Configuration
      • ox_inventory
      • qb-inventory
      • esx_inventory
      • Setup New Mechanic Location
    • Job Setup
      • ESX Framework Jobs
    • Inventory Items
    • Props
    • Tuning
    • Manual Transmissions & Smooth First Gear
    • Integrations
    • Commands, Events & Exports
      • Commands
      • Events
      • Exports
    • Changelog
      • v1.3.0
      • v1.2.0
      • v1.1.3
      • v1.1.2
      • v1.1.1
      • v1.1
      • v1.0.12
      • v1.0.11
      • v1.0.10
      • v1.0.9
      • v1.0.8
      • v1.0.7
      • v1.0.6
      • v1.0.5 - hotfix
      • v1.0.5
      • v1.0.4
      • v1.0.3
      • v1.0.2
      • v1.0.1
  • ๐Ÿš˜Dealerships
    • Introduction
    • Installation & Configuration
    • Advanced Configuration
    • Job Dealership Setup
    • License Check
    • Importing Vehicles
    • Dealership Locations
    • Employees
    • Custom Payment Options
    • Plate Format
    • Vehicle Images
    • Languages
    • Commands, Events & Exports
      • Commands
      • Events
    • Integrations
      • Quasar Garages
      • Pickle Mods Documents
      • okokContract
      • qb-vehiclesales
    • Changelog
      • v1.4.0
      • v1.3.1
      • v1.3.0
      • v1.2.6
      • v1.2.5
      • v1.2.4
      • v1.2.3
      • v1.2.2
      • v1.2.1
      • v1.2
      • v1.1.9
      • v1.1.8
      • v1.1.7
      • v1.1.6
      • v1.1.5
      • v1.1.4
      • v1.1.3
      • v1.1.2
      • v1.1.1
      • v1.1
      • v1.0.3
      • v1.0.2
      • v1.0.1
  • ๐Ÿš—Advanced Garages v3
    • Introduction
    • Installation & Configuration
    • Migration from v1
    • Public, Private & Impound Garages
    • Job & Gang Garages
    • Transferring Vehicles
    • Vehicle Duplication Prevention
    • Vehicle Images
    • Languages
    • Commands, Events & Exports
      • Commands
      • Events
      • Exports
    • Misc
      • Spawn Vehicles with ServerSetter
      • Why are you not using CreateVehicleServerSetter by default?
    • Troubleshooting
      • Execution of native... SetDriftTyresEnabled error
      • ucrtbase.dll!strcmp crash
      • SQL error: foreign key constraint fails
    • Integrations
      • qb-phone
      • npwd
      • RoadPhone
      • Quasar Smartphone
      • Quasar Housing
      • okokDeleteVehicles
      • ps-housing
      • nolag_properties
      • Brazzers-FakePlate
      • Custom Fuel System
      • Custom Key System
    • Guides
      • ESX Guides
        • Vehicle Labels
      • QBCore Guides
        • Why isn't /admincar working?!
        • Liveries not saving
    • Changelog
      • v3.2.1
      • v3.2.0
      • v3.1.6
      • v3.1.5
      • v3.1.4
      • v3.1.3
      • v3.1.2
      • v3.1.1
      • v3.1.0
      • v3.0.8
      • v3.0.7
      • v3.0.6
      • v3.0.5
      • v3.0.4
      • v3.0.3
      • v3.0.2
      • v3.0.1
      • v3
      • v2.2.9
      • v2.2.8
      • v2.2.7
      • v2.2.6
      • v2.2.5
      • v2.2.4
      • v2.2.3
      • v.2.2.2
      • v2.2.1
      • v2.2.0
      • v2.1.2
      • v2.1.1
      • v2.1
      • v2.0.7
      • v2.0.6
      • v2.0.5
      • v2.0.4
      • v2.0.3
      • v2.0.2
      • v2.0.1
  • ๐Ÿ“ŠHandling
    • Introduction
    • Installation
    • Exports
  • ๐ŸŽฎPro Scoreboard
    • Introduction
    • Installation
    • Config & Customisation
  • Advanced Garages v1
    • QB Installation & Config
    • ESX Installation & Config
Powered by GitBook
On this page
  • Step 1. Download the latest releases of ox-lib and Brazzers-FakePlate if you do not have them!
  • Step 2. Modifiy the shared_scripts Section of the Garage's fxmanifest.lua
  • Step 3. Edit The Framework.Client.GetPlate Function in 'Framework/cl-functions.lua'
  • Step 4. Modify the jg-advancedgarages:client:TakeOutVehicle:config Event in 'config-cl.lua'
  • Step 5. Add The Following to config-sv.lua
  • Step 6. Modify the Vehicle Key Functions to recognize the Fake Plate

Was this helpful?

Edit on GitHub
  1. Advanced Garages v3
  2. Integrations

Brazzers-FakePlate

Last updated 10 months ago

Was this helpful?

This guide is for v2 only. Brazzers-FakePlate is integrated by default in v3! This article will be removed shortly after the release of v3.

This code was provided to us by IgnoranceIsBliss.

This code has been tested and works. It requires some code editing for garages and relies on ox-lib.

Step 1. Download the latest releases of ox-lib and Brazzers-FakePlate if you do not have them!

Step 2. Modifiy the shared_scripts Section of the Garage's fxmanifest.lua

Replace the section with the one below.

shared_scripts {'config.lua', 'locales/*.lua', '@ox_lib/init.lua', 'main.lua', 'framework/main.lua'}

Step 3. Edit The Framework.Client.GetPlate Function in 'Framework/cl-functions.lua'

Replace the GetPlate Section with below.

function Framework.Client.GetPlate(vehicle)
  if Config.Framework == "QBCore" then
    local plate = QBCore.Functions.GetPlate(vehicle)
    local originalPlate = lib.callback.await('brazzers-fakeplates:getPlateFromFakePlate', false, plate)
    if originalPlate then plate = originalPlate end
    return plate
  elseif Config.Framework == "ESX" then
    return ESX.Game.GetVehicleProperties(vehicle).plate
  end
end

Step 4. Modify the jg-advancedgarages:client:TakeOutVehicle:config Event in 'config-cl.lua'

Add the below code to the event

local fakePlate = lib.callback.await('brazzers-fakeplates:getFakePlateFromPlate', false, vehicleDbData.plate)
    if fakePlate then SetVehicleNumberPlateText(vehicle,fakePlate) end

Step 5. Add The Following to config-sv.lua

lib.callback.register('brazzers-fakeplates:getPlateFromFakePlate', function(source, fakeplate)
    local result = MySQL.scalar.await('SELECT plate FROM player_vehicles WHERE fakeplate = ?', {fakeplate})
    if result then
        return result
    end 
end)

lib.callback.register('brazzers-fakeplates:getFakePlateFromPlate', function(source, plate)
    local result = MySQL.scalar.await('SELECT fakeplate FROM player_vehicles WHERE plate = ?', {plate})
    if result then
        return result
    end
end)

Step 6. Modify the Vehicle Key Functions to recognize the Fake Plate

Find Framework.Client.VehicleGiveKeys(plate, vehicleEntity) and add the below code after if not DoesEntityExist(vehicleEntity) then return false end

 local fakePlate = lib.callback.await('brazzers-fakeplates:getFakePlateFromPlate', false, plate)
  if fakePlate then plate = fakePlate end

Do the Same for Framework.Client.VehicleRemoveKeys(plate, vehicleEntity)

local fakePlate = lib.callback.await('brazzers-fakeplates:getFakePlateFromPlate', false, plate)
  if fakePlate then plate = fakePlate end
๐Ÿš—
LogoGitHub - Brazzers-Development/brazzers-fakeplatesGitHub
LogoReleases ยท overextended/ox_libGitHub