mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-01 10:48:52 +00:00
fix(es_extended/client/main): track parachute opening to remove from loadout
This commit is contained in:
@@ -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 <const> = 1
|
||||
local PARACHUTE_OPEN <const> = 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
|
||||
|
||||
Reference in New Issue
Block a user