Vehicle Keys

If you're facing an issue where taxi doors unexpectedly close when players try to enter, it's likely due to the vehicle keys script on your server. This happens when the script forcefully locks NPC vehicles, unintentionally locking taxi doors as well.

We've already applied an inbuilt patch, but sometimes vehicle keys scripts override it. To fully resolve this, follow the steps below.

If you're using qb-vehiclekeys and NPC vehicles are set to lock, follow these steps:

  1. Open the main.lua file in the qb-vehiclekeys/client folder.

  2. Go to line 58, and modify the file as shown below:

else -- > approx line 57
    if not exports["eh_cutscene"]:isVehicleTaxi(entering) 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
This is how the modified code should look like

If you're not using either of these two vehicle keys scripts and still facing the issue, you can easily resolve it using the same method. Alternatively, you can join our Discord for further support.

Last updated