diff --git a/[core]/es_extended/client/main.lua b/[core]/es_extended/client/main.lua index 6a3eba71..5df66c32 100644 --- a/[core]/es_extended/client/main.lua +++ b/[core]/es_extended/client/main.lua @@ -303,7 +303,7 @@ function StartServerSyncLoops() if weaponConfig then currentWeapon.ammo = GetAmmoInPedWeapon(ESX.PlayerData.ped, currentWeapon.hash) - while (GetSelectedPedWeapon(ESX.PlayerData.ped) == currentWeapon.hash) do Citizen.Wait(500) end + while GetSelectedPedWeapon(ESX.PlayerData.ped) == currentWeapon.hash do Wait(500) end local newAmmo = GetAmmoInPedWeapon(ESX.PlayerData.ped, currentWeapon.hash) if newAmmo ~= currentWeapon.ammo then @@ -314,6 +314,22 @@ function StartServerSyncLoops() Wait(250) end end) + + CreateThread(function() + local PARACHUTE_OPENING = 1 + local PARACHUTE_OPEN = 2 + + while ESX.PlayerLoaded do + local parachuteState = GetPedParachuteState(ESX.PlayerData.ped) + + if parachuteState == PARACHUTE_OPENING or parachuteState == PARACHUTE_OPEN then + while GetPedParachuteState(ESX.PlayerData.ped) ~= -1 do Wait(1000) end + + TriggerServerEvent("esx:updateWeaponAmmo", "GADGET_PARACHUTE", 0) + end + Wait(500) + end + end) end if not Config.CustomInventory and Config.EnableDefaultInventory then