Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,24 @@ CreateThread(function()
SetWeaponsNoAutoswap(true)
end)


CreateThread(function()
while true do
local ped = PlayerPedId()
if IsPedArmed(ped, 7) == 1 and (IsControlJustReleased(0, 24) or IsDisabledControlJustReleased(0, 24)) then
local weapon = GetSelectedPedWeapon(ped)
local ammo = GetAmmoInPedWeapon(ped, weapon)
TriggerServerEvent('qb-weapons:server:UpdateWeaponAmmo', CurrentWeaponData, tonumber(ammo))
if MultiplierAmount > 0 then
TriggerServerEvent('qb-weapons:server:UpdateWeaponQuality', CurrentWeaponData, MultiplierAmount)
MultiplierAmount = 0
if GetSelectedPedWeapon(ped) ~= `WEAPON_UNARMED` then
if IsPedArmed(ped, 7) == 1 and (IsControlJustReleased(0, 24) or IsDisabledControlJustReleased(0, 24)) then
local weapon = GetSelectedPedWeapon(ped)
local ammo = GetAmmoInPedWeapon(ped, weapon)
TriggerServerEvent('qb-weapons:server:UpdateWeaponAmmo', CurrentWeaponData, tonumber(ammo))
if MultiplierAmount > 0 then
TriggerServerEvent('qb-weapons:server:UpdateWeaponQuality', CurrentWeaponData, MultiplierAmount)
MultiplierAmount = 0
end
end
Wait(0)
else
Wait(1000)
end
Wait(0)
end
end)

Expand All @@ -222,9 +227,12 @@ CreateThread(function()
end
end
end
Wait(0)
else
Wait(1000)
end
end
Wait(0)
Wait(1)
end
end)

Expand Down