qb-smallresources icon indicating copy to clipboard operation
qb-smallresources copied to clipboard

[FIX] Gun draw glitch

Open DemonLawyerr opened this issue 10 months ago • 5 comments

Is your feature request related to a problem? Please describe. So, everytime you have a weapon equiped and try to equip a new one, you get into the animation but don't get the weapon out.

Describe the feature you'd like Fix the line in the code, you just need to repalce SetCurrentPedWeapon(ped, 'weapon_unarmed', true) in line 240, between the 2 animations, with SetCurrentPedWeapon(ped, newWeap, true)

Additional context I was furious that the resource was bugged and i couldnt equip my gun, this is a simple and fast solution. But can be altered, i just don't know how to code, i played with the code until it worked.

DemonLawyerr avatar Apr 28 '24 20:04 DemonLawyerr

if you experience a lag when equiping a gun while running, in the means of:

  1. You run with a gun
  2. you start switching
  3. You lag between the switch

It's because of TaskPlayAnimAdvanced on 241, either disable it by typing -- next to it, or try something else.

DemonLawyerr avatar Apr 28 '24 20:04 DemonLawyerr

after: https://s1.ezgif.com/tmp/ezgif-1-1268f725cd.gif

before: https://s1.ezgif.com/tmp/ezgif-1-59565728b9.gif

DemonLawyerr avatar Apr 28 '24 20:04 DemonLawyerr

I did that to all locations that had that had the unarmed task and taskplayanim and now there is seamless transition from 1 gun to the next. You can run and just switch guns like nothing, no more glitch. Thanks for this.

mfel2k avatar Apr 29 '24 21:04 mfel2k

I did that to all locations that had that had the unarmed task and taskplayanim and now there is seamless transition from 1 gun to the next. You can run and just switch guns like nothing, no more glitch. Thanks for this.

Can you show me how? I commented out all the taskplayanim and now the animation is cut off

DarkPeluxin avatar Jun 21 '24 12:06 DarkPeluxin

I apologize for the late reply DarkPeluxin Find the weapdraw.lua if you are using the old qb-core it is under qb-smallresources and if you are using the new qb-core it is under the qb-weapons. Look for anywhere that you find the following

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(300)

Comment them out by doing this

--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(300)

If you do that at every single location your character will put their hand to their hip and then their gun will go to their hand. It removes that FULL animation which prevents it from lagging and then failing to complete

mfel2k avatar Aug 11 '24 15:08 mfel2k

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

github-actions[bot] avatar Oct 11 '24 15:10 github-actions[bot]