If you're using qb-vehiclekeys and NPC vehicles are set to unlock, follow these steps:
Open the main.lua file in the qb-vehiclekeys/client folder.
Go to line 58, and modify the file as shown below:
else -- line 57
if not plate == 'Your Plate Here' then
TriggerServerEvent('qb-vehiclekeys:server:setVehLockState', NetworkGetNetworkIdFromEntity(entering), 1)
TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', plate)
--Make passengers flee
local pedsInVehicle = GetPedsInVehicle(entering)
for _, pedInVehicle in pairs(pedsInVehicle) do
if pedInVehicle ~= GetPedInVehicleSeat(entering, -1) then
MakePedFlee(pedInVehicle)
end
end
end
end
Replace 'Your Plate Here' with your taxi's actual number plate (e.g., 'ERRORHUB') on line 58.
Search for SetVehicleDoorsLocked(entering, 1) in the main.lua file.
Replace it with the following code:
if not plate == 'Your Plate Here' then
SetVehicleDoorsLocked(entering, 1)
end
Replace 'Your Plate Here' with your taxi's actual number plate (e.g., 'ERRORHUB'). For Example:
if not plate == 'ERRORHUB' then
SetVehicleDoorsLocked(entering, 1)
end