{% hint style="warning" %}
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.
{% endhint %}
{% hint style="info" %} 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. {% endhint %}
{% embed url="https://github.com/Brazzers-Development/brazzers-fakeplates" %}
{% embed url="https://github.com/overextended/ox_lib/releases" %}
Replace the section with the one below.
shared_scripts {'config.lua', 'locales/*.lua', '@ox_lib/init.lua', 'main.lua', 'framework/main.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
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
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)
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