Hi there! I love the UI and I have been able to get it to work on my older server, but I recently did a migration, and I haven’t been able to get both of bars to work.
As of right now, only the get the thirst bar to work. I’ve reinstalled both status and basic needs a few times, with no success. I’ve noticed that if I attempt to install other status bar resources, it does the same thing.
Has anyone else had this issue and found a solution?
Everything looks fine in the console. I tried replacing the GetStatusData function with the status variable in esx_status, and am still having the same issue. (Code below)
I have the esx_stat:onTick uncommented so I can still see the needs bar.
I’m not too sure what else to try.
RegisterNetEvent('esx_status:load')
AddEventHandler('esx_status:load', function(status)
for i=1, #Status, 1 do
for j=1, #status, 1 do
if Status[i].name == status[j].name then
Status[i].set(status[j].val)
end
end
end
Citizen.CreateThread(function()
while true do
for i=1, #Status, 1 do
Status[i].onTick()
end
SendNUIMessage({
update = true,
status = GetStatusData()
})
TriggerEvent('esx_ladderhud:updateBasics', GetStatusData(true))
--TriggerEvent('esx_ladderhud:updateBasics', status)
TriggerEvent('esx_status:onTick', GetStatusData(true))
Citizen.Wait(Config.TickTime)
end
end)
end)
You say other status bar resources have the same issue. I’m guessing the default esx_basicneeds status bars also have the same issue after your migration?
If so, I would guess the issue to be related to the values that are being retrieved and worked with for the status bar itself.
Since you say it was a migration and not a complete fresh server, is it safe to assume you are using your original database and didn’t wipe it clean?
If so, I would suggest you take a look at your Databases values under status in your users table.
Assuming your database is named essentialmode… MySQL commands to check status values:
USE `essentialmode`;
SELECT `status` FROM `users`;
Here’s what the output should look like (a single status value from my database)
(my server is very current; just started development 2 weeks ago… but haven’t installed any custom status bar resources yet. So just using the default ones and they are of course working fine)
If your status values are different/missing anything, I would drop the column and recreate it.
ALTER TABLE `users` DROP `status`;
ALTER TABLE `users` ADD COLUMN `status` LONGTEXT NULL;
Hopefully this helped. I would also suggest adding this line to the top of your server.cfg (above your database credentials) to have debugging output into your server’s console
Awesome! Thank you so much!
I ran the first query and got a look at my status column, and I noticed some problems. I ran the second set of queries and that fixed the SQL problem over all. Now my status column looks like this:
someone tells me where I can change the place where it appears and if it would be a lot of trouble they could tell me how to put it on top of the map (coordinates)
Done all the things in the README file but there is only a UI coming out without really counting and the basic one is still there even i replace all the things the file told me to.
Add TriggerEvent in (resources[esx]\esx_status\client\main.lua esx_status:load)
TriggerEvent('esx_ladderhud:updateBasics', GetStatusData(true))
to look like this
RegisterNetEvent('esx_status:load')
AddEventHandler('esx_status:load', function(status)
for i=1, #Status, 1 do
for j=1, #status, 1 do
if Status[i].name == status[j].name then
Status[i].set(status[j].val)
end
end
end
Citizen.CreateThread(function()
while true do
for i=1, #Status, 1 do
Status[i].onTick()
end
SendNUIMessage({
update = true,
status = GetStatusData()
})
TriggerEvent('esx_ladderhud:updateBasics', GetStatusData(true))
Citizen.Wait(Config.TickTime)
end
end)
end)
Disabling Basic Needs Bars (resources[esx]\esx_basicneeds\client\main.lua esx_status:loaded)
AddEventHandler('esx_status:loaded', function(status)
TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#FFFF00', -- amarelo
--TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F', -- GOLD
function(status)
return false -- Change to true to show hunger bar | false to hide hunger bar
end, function(status)
status.remove(100)
end
)
TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0099FF', -- azul
--TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0C98F1', -- CYAN
function(status)
return false -- Change to true to show thirst bar | false to hide thirst bar
end, function(status)
status.remove(75)
end
)