Skip to content

Commit

Permalink
Merge pull request #557 from Sanriku-Gaming/patch-1
Browse files Browse the repository at this point in the history
fix checkWeapon function
  • Loading branch information
GhzGarage authored Jul 28, 2024
2 parents 118126b + f70da43 commit f09850e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@ end)
-- Functions

local function checkWeapon(source, item)
local currentWeapon = type(item) == 'table' and item.name or item
local ped = GetPlayerPed(source)
local weapon = GetSelectedPedWeapon(ped)
local weaponInfo = QBCore.Shared.Weapons[weapon]
if weaponInfo and weaponInfo.name == item.name then
if weaponInfo and weaponInfo.name == currentWeapon then
RemoveWeaponFromPed(ped, weapon)
TriggerClientEvent('qb-weapons:client:UseWeapon', source, { name = currentWeapon }, false)
end
end

Expand Down

0 comments on commit f09850e

Please sign in to comment.