Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Weapon firies twice in quick succession if playing custom weapon style #1861

Open
TheRealBablo opened this issue Jan 1, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@TheRealBablo
Copy link

TheRealBablo commented Jan 1, 2025

Describe the bug
If you are playing a custom weapon style animation it will fire twice in quick succession but if you arent using any custom weapon style it works fine so i think it has something to do with if you are playing an animation and also firing a weapon

Framework
ESX Legacy

Resource version
2.43.4

To Reproduce

  RegisterCommand("hillbilly", function()
	  SetWeaponAnimationOverride(cache.ped, GetHashKey("Hillbilly"))
  
	  Citizen.CreateThread(function()
		  while true do 
			  local dict, anim = "combat@aim_variations@1h@hillbilly", "aim_variation_a"
  
			  if IsPedArmed(cache.ped, 4) then
				  while not HasAnimDictLoaded(dict) do
					  Wait(25)
					  RequestAnimDict(dict)
				  end
  
				  local _,hash = GetCurrentPedWeapon(cache.ped, 1)
  
				  if IsPlayerFreeAiming(PlayerId()) or (IsControlPressed(0, 24) and GetAmmoInClip(cache.ped, hash) > 0) then
					  if not IsEntityPlayingAnim(cache.ped, dict, anim, 3) then
						  TaskPlayAnim(cache.ped, dict, anim, 8.0 ,-8.0, -1, 49, 0, 0, 0, 0)
					  end
				  elseif IsEntityPlayingAnim(cache.ped, dict, anim, 3) then
					  ClearPedTasks(cache.ped)
				  end
			  end
  
			  Citizen.Wait(200)
		  end
	  end)
  end)

Expected behavior
For it to only shoot once

Screenshots
Video of issue

@TheRealBablo TheRealBablo added the bug Something isn't working label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant