qbcore-framework / qb-smallresources

A compilation of small resources combined into one
GNU General Public License v3.0
51 stars 346 forks source link

[FIX] Weapon Drawing Glitching and Not Properly Switching Weapons #411

Closed PhysiksTV closed 7 months ago

PhysiksTV commented 9 months ago

Describe the bug Weapon Drawing Often Causes Players to ghost the weapon in their hands and must press to put away and then draw again. By simply

To Reproduce Just try to switch weapons in its current state, many people experience this glitch.

*Suggestion in qb-smallresources\client\weapondraw.lua Go to the Lines around 246 image I changed 3 values for Wait to slightly longer to avoid the mix up of one starting beforfe the other causing an animation mixup which in turn stopped the gun from being used until weapon select was cycled again. Changing these 3 values made no change except a smooth transfer between guns without an issue.

PROOF OF FIX https://i.imgur.com/0Vtyn48.gifv

Additional context Thank you!

PhysiksTV commented 9 months ago

Problem returned. Not working

icodenaked90 commented 9 months ago

Give this a try,its not perfect, but if you play around with a little then u will see the problem. the issue is when u swap from weapon to weapon.

elseif newWeap ~= currWeapon and CheckWeapon(currWeapon) then
                        if WearingHolster then
                            canFire = false
                            CeaseFire()
                            TaskPlayAnimAdvanced(ped, "reaction@intimidation@cop@unarmed", "intro", pos.x, pos.y, pos.z, 0, 0, rot, 3.0, 3.0, -1, 50, 0, 0, 0)
                            Wait(500)

                            if IsWeaponHolsterable(currWeapon) then
                                SetPedComponentVariation(ped, 7, currentHolster, currentHolsterTexture, 0)
                            end

                            currentHolster = GetPedDrawableVariation(ped, 7)
                            currentHolsterTexture = GetPedTextureVariation(ped, 7)

                            TaskPlayAnimAdvanced(ped, "rcmjosh4", "josh_leadout_cop2", pos.x, pos.y, pos.z, 0, 0, rot, 3.0, 3.0, -1, 50, 0, 0, 0)
                            Wait(500)

                            SetCurrentPedWeapon(ped, newWeap, true)
                            currWeapon = newWeap
                            ClearPedTasks(ped)
                            holstered = false
                            canFire = true
                        else
                            canFire = false
                            CeaseFire()
                            TaskPlayAnimAdvanced(ped, "reaction@intimidation@1h", "outro", pos.x, pos.y, pos.z, 0, 0, rot, 8.0, 3.0, -1, 50, 0, 0, 0)
                            Wait(1600)

                            TaskPlayAnimAdvanced(ped, "reaction@intimidation@1h", "intro", pos.x, pos.y, pos.z, 0, 0, rot, 8.0, 3.0, -1, 50, 0, 0, 0)
                            Wait(500)
                            SetCurrentPedWeapon(ped, newWeap, true)
                            currWeapon = newWeap
                            ClearPedTasks(ped)
                            holstered = false
                            canFire = true
                        end
PhysiksTV commented 9 months ago

TESTING NOW -

PhysiksTV commented 9 months ago

Doesnt Work | When you have a weapon in your hands and you switch, there is NO animation and you'll have to press the pocket twice to swap. I wish we could get one of them in here to fix this issue as its very annoying and on many servers.

github-actions[bot] commented 7 months ago

This issue has had 60 days of inactivity & will close within 7 days