mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 08:13:21 +00:00
Fix Formatting
This commit is contained in:
@@ -394,25 +394,25 @@ function StartServerSyncLoops()
|
||||
CreateThread(function()
|
||||
local currentWeapon = {Ammo = 0}
|
||||
while ESX.PlayerLoaded do
|
||||
local sleep = 250
|
||||
if IsPedArmed(ESX.PlayerData.ped, 4) or IsPedArmed(ESX.PlayerData.ped, 2) then
|
||||
sleep = 0
|
||||
local _,weaponHash = GetCurrentPedWeapon(ESX.PlayerData.ped, true)
|
||||
local weapon = ESX.GetWeaponFromHash(weaponHash)
|
||||
if weapon then
|
||||
local ammoCount = GetAmmoInPedWeapon(ESX.PlayerData.ped, weaponHash)
|
||||
if weapon.name ~= currentWeapon.name then
|
||||
currentWeapon.Ammo = ammoCount
|
||||
currentWeapon.name = weapon.name
|
||||
else
|
||||
if ammoCount ~= currentWeapon.Ammo then
|
||||
currentWeapon.Ammo = ammoCount
|
||||
TriggerServerEvent('esx:updateWeaponAmmo', weapon.name, ammoCount)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Wait(sleep)
|
||||
local sleep = 250
|
||||
if IsPedArmed(ESX.PlayerData.ped, 4) or IsPedArmed(ESX.PlayerData.ped, 2) then
|
||||
sleep = 0
|
||||
local _,weaponHash = GetCurrentPedWeapon(ESX.PlayerData.ped, true)
|
||||
local weapon = ESX.GetWeaponFromHash(weaponHash)
|
||||
if weapon then
|
||||
local ammoCount = GetAmmoInPedWeapon(ESX.PlayerData.ped, weaponHash)
|
||||
if weapon.name ~= currentWeapon.name then
|
||||
currentWeapon.Ammo = ammoCount
|
||||
currentWeapon.name = weapon.name
|
||||
else
|
||||
if ammoCount ~= currentWeapon.Ammo then
|
||||
currentWeapon.Ammo = ammoCount
|
||||
TriggerServerEvent('esx:updateWeaponAmmo', weapon.name, ammoCount)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Wait(sleep)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user