diff --git a/client/main.lua b/client/main.lua index 813ee33..ea92b66 100644 --- a/client/main.lua +++ b/client/main.lua @@ -120,13 +120,14 @@ RegisterNetEvent('qb-weapons:client:UseWeapon', function(weaponData, shootbool) local ped = PlayerPedId() local weaponName = tostring(weaponData.name) local weaponHash = joaat(weaponData.name) - if currentWeapon == weaponName then + if currentWeapon then TriggerEvent('qb-weapons:client:DrawWeapon', nil) SetCurrentPedWeapon(ped, `WEAPON_UNARMED`, true) RemoveAllPedWeapons(ped, true) TriggerEvent('qb-weapons:client:SetCurrentWeapon', nil, shootbool) currentWeapon = nil - elseif weaponName == 'weapon_stickybomb' or weaponName == 'weapon_pipebomb' or weaponName == 'weapon_smokegrenade' or weaponName == 'weapon_flare' or weaponName == 'weapon_proxmine' or weaponName == 'weapon_ball' or weaponName == 'weapon_molotov' or weaponName == 'weapon_grenade' or weaponName == 'weapon_bzgas' then + end + if weaponName == 'weapon_stickybomb' or weaponName == 'weapon_pipebomb' or weaponName == 'weapon_smokegrenade' or weaponName == 'weapon_flare' or weaponName == 'weapon_proxmine' or weaponName == 'weapon_ball' or weaponName == 'weapon_molotov' or weaponName == 'weapon_grenade' or weaponName == 'weapon_bzgas' then TriggerEvent('qb-weapons:client:DrawWeapon', weaponName) GiveWeaponToPed(ped, weaponHash, 1, false, false) SetPedAmmo(ped, weaponHash, 1)