Help ESX police job (putting people in back seat)

so I’m trying to make it so that the police can put 2 people in the back seat as of now cops can only put one person in the back of a police car with the esx_police job everything works unto I go to put another person into the back seat I get no errors or anything just the player does nothing this is what i have as of now

RegisterNetEvent('esx_policejob:putInVehicle')
AddEventHandler('esx_policejob:putInVehicle', function()
    local playerPed = PlayerPedId()
    local coords = GetEntityCoords(playerPed)

    if not IsHandcuffed then
        return
    end

    if IsAnyVehicleNearPoint(coords, 5.0) then
        local vehicle = GetClosestVehicle(coords, 5.0, 0, 71)

        if DoesEntityExist(vehicle) then
            local maxSeats, freeSeat = GetVehicleMaxNumberOfPassengers(vehicle)

            for i=maxSeats - 2, 0, -1 do
                if IsVehicleSeatFree(vehicle, i) then
                    freeSeat = i
                    break
                end
            end

            if freeSeat then
                TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat)
                DragStatus.IsDragged = false
            end
        else

            for g=maxSeats2 - 1, 0, -1 do
                if IsVehicleSeatFree(vehicle, g) then
                    freeSeat2 = g
                    break
                end
            end

            if freeSeat2 then
                TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat2)
                DragStatus.IsDragged = false
            end
        end
    end
end)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.