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

Fixed equipped weapon not removing from the player hand on clear inventory. #601

Merged

Conversation

adhershmnair
Copy link
Contributor

@adhershmnair adhershmnair commented Nov 24, 2024

Description

Equipped weapon doesn't remove from player's hand when inventory cleared.

Checklist

  • I have personally loaded this code into an updated qbcore project and checked all of its functionality.
  • My code fits the style guidelines.
  • My PR fits the contribution guidelines.

@adhershmnair adhershmnair changed the title Fixed equiped weapon not removing from the player hand on clear inventory. Fixed equipped weapon not removing from the player hand on clear inventory. Nov 24, 2024
Comment on lines 433 to 437
local ped = GetPlayerPed(source)
local weapon = GetSelectedPedWeapon(ped)
if weapon ~= GetHashKey('WEAPON_UNARMED') then
RemoveWeaponFromPed(ped, weapon)
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all equipped weapon from ped on clear inventory.

server/functions.lua Outdated Show resolved Hide resolved
@GhzGarage GhzGarage merged commit 3b5b67d into qbcore-framework:main Nov 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants