Skip to content

Commit

Permalink
Merge pull request #601 from adhershmnair/fix-weapon-not-remove-issue
Browse files Browse the repository at this point in the history
Fixed equipped weapon not removing from the player hand on clear inventory.
  • Loading branch information
GhzGarage authored Nov 26, 2024
2 parents 949ca19 + 59eb0db commit 3b5b67d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,11 @@ function ClearInventory(source, filterItems)
if not player.Offline then
local logMessage = string.format('**%s (citizenid: %s | id: %s)** inventory cleared', GetPlayerName(source), player.PlayerData.citizenid, source)
TriggerEvent('qb-log:server:CreateLog', 'playerinventory', 'ClearInventory', 'red', logMessage)
local ped = GetPlayerPed(source)
local weapon = GetSelectedPedWeapon(ped)
if weapon ~= `WEAPON_UNARMED` then
RemoveWeaponFromPed(ped, weapon)
end
if Player(source).state.inv_busy then TriggerClientEvent('qb-inventory:client:updateInventory', source) end
end
end
Expand Down

0 comments on commit 3b5b67d

Please sign in to comment.