mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 09:48:52 +00:00
refactor: Optimize weapon ammo tracking
This commit is contained in:
+6
-4
@@ -362,11 +362,10 @@ function StartServerSyncLoops()
|
||||
while true do
|
||||
Citizen.Wait(1000)
|
||||
|
||||
if isDead then
|
||||
Citizen.Wait(500)
|
||||
else
|
||||
local playerPed = PlayerPedId()
|
||||
local letSleep = true
|
||||
local playerPed = PlayerPedId()
|
||||
|
||||
if IsPedArmed(playerPed, 4) then
|
||||
if IsPedShooting(playerPed) then
|
||||
local _,weaponHash = GetCurrentPedWeapon(playerPed, true)
|
||||
local weapon = ESX.GetWeaponFromHash(weaponHash)
|
||||
@@ -377,6 +376,9 @@ function StartServerSyncLoops()
|
||||
end
|
||||
end
|
||||
end
|
||||
if letSleep then
|
||||
Citizen.Wait(500)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user