There are some minor problems when updating a vehicle's plate. In order to fix those, you will need to exchange the function SetVehicleNumberPlateText with the following function:
exports["AdvancedParking"]:UpdatePlate
The variables in the parenthesis at the end should stay the same! Do not remove them!
Example:
SetVehicleNumberPlateText(vehicle, "TEST1234")-- into this:exports["AdvancedParking"]:UpdatePlate(vehicle, "TEST1234")
qb-vehiclekeys
Issue
qb-vehiclekeys doesn't properly recognize owned vehicles after a server restart. You cannot (un)lock them.
Solution
Add the following snippet at the bottom of your qb-vehiclekeys/server/main.lua and restart your server.
RegisterNetEvent("QBCore:Server:OnPlayerLoaded", function()local playerId = sourcelocal citizenid = QBCore.Functions.GetPlayer(playerId).PlayerData.citizenid exports.oxmysql:execute("SELECT `plate` FROM `player_vehicles` WHERE `citizenid` = ?", { citizenid }, function(result)for i =1, #result dolocal plate = result[i].plateifnot VehicleList[plate] then VehicleList[plate] = {}end VehicleList[plate][citizenid] =trueTriggerClientEvent("qb-vehiclekeys:client:AddKeys", playerId, plate)endend)end)
okokGarage keys
Issue
Same as qb-vehiclekeys. It doesn't properly recognize owned vehicles after a server restart. You cannot (un)lock them.
Solution (for ESX)
Add the following snippet at the bottom of the sv_utils.lua inside okokGarage.
RegisterNetEvent('okok:server:CheckOwnerExt', function()local src = sourcelocal xPlayer = ESX.GetPlayerFromId(src)local APExports = exports["AdvancedParking"]MySQLfetchAll('SELECT owner, plate FROM owned_vehicles WHERE owner = ? OR owner = ?', {xPlayer.identifier, xPlayer.job.name}, function(result)for i =1, #result doif (APExports:GetVehiclePosition(result[i].plate)) thenTriggerEvent('okokGarage:GiveKeys', result[i].plate, src)endendend)end)
And add the following snippet at the bottom of the cl_utils.lua inside okokGarage.
cd_garage uses a weird function to delete vehicles. Because of that, the usual fix will not work for this script.
Solution
Add a Wait(1000) in between lines 113/114 inside AdvancedParking/client/client.lua.
Should look like this:
-- when a player left a vehiclefunctionLeftVehicle(vehicle)Wait(1000)if (notDoesEntityExist(vehicle) ornotNetworkGetEntityIsNetworked(vehicle) orIsVehicleBlacklisted(vehicle)) then
Find the function CD_DeleteVehicle inside cd_garage/client/functions.lua and add the following code right after the first line:
if (GetResourceState("AdvancedParking") =="started") then exports["AdvancedParking"]:DeleteVehicle(vehicle)returnend