ESX_STATUS Not Working, No Apparent Errors

Good morning guys,

I’m writing here as a last resort, I think I’ve searched the whole forum and some other sites but can’t get an answer.

I installed esx_status and esx_basicneeds to use on my personal server but nothing is being done by the scripts. I know they are getting loaded because I have the possibility to “use” bread and water, however, esx_status apparently is not doing anything.

When I check my database for the “status” column they are either empty or containing “[ ]”. My guess is that esx_status is not managing to update the status but I don’t know why. All other scripts can read/write on the database with no problem.

I have everything up to date and both resources are added with ensure in my server.cfg.

I saw on esx_status readme file that you have to add this on server.lua:

local name    = 'hunger'
local default = 1000000
local color   = '#CFAD0F'

TriggerEvent('esx_status:registerStatus', name, default, color, 
	function(status) -- Visible calllback, if it return true the status will be visible
		return true
	end,
	function(status) -- Tick callback, what to do at each tick
		status.remove(200)
	end,
	{remove = 200} -- Client action (add / remove) so the client can be in sync with server
)

However, no server.lua exists on my resource, only main.lua in the server folder. But, also, those lines of code are already present in client/main.lua.

Does anyone know what might be happening?

Thanks for your time, any help will be appreciated!

Unfortunately I’m still having this problem… :frowning:

I modified client\main.lua for both esx_status and esx_basicneeds to debug if it was properly finding ESX like this:

Citizen.CreateThread(function()
	while ESX == nil do
		print("Looking For ESX")
		TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
		Citizen.Wait(0)
	end
end) 

I get that message printed on the console once for each script, so I’m assuming it is finding/connecting with ESX.

Regarding my previous message and the TriggerEvent(‘esx_status:registerStatus’ for hunger and thirst I see that this is already registered on esx_basicneeds\client.lua so hopefully the origin of my problem is not that.

I also modified the esx:registerStatus on esx_status\client\main.lua like to debug like this:

AddEventHandler('esx_status:registerStatus', function(name, default, color, visible, tickCallback)
	local status = CreateStatus(name, default, color, visible, tickCallback)
	table.insert(Status, status)
	print("Registering Status")
end)

However, I never see the registering status message on the console…

With the information I have my guess is both esx_status and esx_basicneeds are getting initialised but they aren’t running properly. As I said on my previous post I’m running all resources on their latest version and have not modified anything regarding database structure, etc and have all SQL code required by the resources in my database.

Any help will be greatly appreciated, I’m a bit frustrated and don’t know how to get around this. Thanks for your time and have a great day!

I gave up and went back to the old ESX version. Now I have all my resources working :slight_smile:

I hope I can migrate to the new ESX in the future but this will do the job for now, please mark the thread as closed :slight_smile:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.