qbcore-framework / qb-vehiclekeys

Vehicle Keys System For QB-Core :key:
GNU General Public License v3.0
36 stars 225 forks source link

Doorlocks not working, stuck in animation[BUG] #185

Closed onstormchaser closed 1 year ago

onstormchaser commented 1 year ago

Describe the bug When pressing L to lock the doors you hear the sound and the key fob animation loops continuously. No notification for locked or unlocked pops up and the doors do not lock or unlock. No f8 errors or server side errors.

To Reproduce Steps to reproduce the behavior:

  1. Just pressing L to unlock the car.

Expected behavior The door locks should lock and unlock and the animation should not be continuous. Notifications of doors locked or unlocked should also be present.

Screenshots.

Questions (please complete the following information):

Additional context Was working fine until i updated a bunch of qb scripts

TheGoatRico commented 1 year ago

Same issue happening to me.

tom-osborne commented 1 year ago

Key fob?

Are you using the keyfob from https://github.com/qbcore-framework/qb-vehiclekeys/pull/177 ?

onstormchaser commented 1 year ago

No, I mean the animation that our character does when locking and unlocking.

TheGoatRico commented 1 year ago

So to fix mine I had to remove this code from client.lua

            while NetworkGetEntityOwner(veh) ~= 128 do
                NetworkRequestControlOfEntity(veh)
                Wait(0)
            end

And replace with it this

            NetworkRequestControlOfEntity(veh)
            if vehLockStatus == 1 then
                SetVehicleDoorsLocked(veh, 2)
                QBCore.Functions.Notify("Vehicle locked!", "primary")
            else
                SetVehicleDoorsLocked(veh, 1)
                QBCore.Functions.Notify("Vehicle unlocked!", "success")
            end
ahmed608 commented 1 year ago

This error is already fixed in my pr