Ox_lib notifications not on top

Hello, does anybody know how to put ox_lib notifications in front of the hud, because my hud blocks the notifications and i cant read them: (look on upper left)

This might help you, go to the following path inside the script.

ox_lib/web/build/assets/index-3x7-Y31P.css

And put this at the end of the file.

.go4109123758 {
    top: 50% !important;
}

If you have another version, the class name might change, and you can do the following:

1 - Enter here http://localhost:13172/
2 - Click here

3 - Execute any notification.

RegisterCommand("testnoty", function()
    lib.notify({title = "Copy", description = "34535", icon = "fa-regular fa-id-card", iconColor = "#348139"})
end)

4 - Here, you need to be quick and stop the NUI in time while the notification appears.

5 - Now go to the Elements section at the top and look for a structure similar to this:

And that’s it! With the class name, add it at the end of the file, just like in the CSS example I sent you.

It’s not the best solution, but for what you want to do, it will work well. :smiley:

I hope it helps you.

Sorry, might be a stupid question, how do I execute a notification?

You can use my example on a client side

RegisterCommand("testnoty", function()
    lib.notify({title = "Copy", description = "34535", icon = "fa-regular fa-id-card", iconColor = "#348139"})
end)

Don’t worry, we will help you as much as possible. :smiley:

Nonsense also no need to scare people with built nui files vite works really good and makes them close to unreadable.

@timotejzali just decrease your z-index of hud, you need to check for it from hud ui files.
In my guess it needs to be lower than 9999 checked ox_lib source code but couldn’t find it.

You can try it with nui dev tools of fivem before actually looking for files.

Another quick fix: change notification position to somewhere else.

You’re absolutely right. I don’t know why I read or understood it wrong. I actually wanted it centered or lower because of the post title. However, there’s no need to start the message like that, we can be more respectful. I am just a random user trying to help, just like if I see someone making a mistake in their response, as could be my case. I would say, “Hey, there are easier ways.” I wouldn’t just disregard others’ work and say “nonsense” :neutral_face:

By the way, you can’t adjust the z-index of two independent scripts. The iframes of UIs in FiveM don’t follow that kind of order; they work differently.

I forgot to mention it earlier.

I didn’t want to offend you, i don’t know the exact word and used deepl translator it suggested “bullshit” and “nonsense” i choosed.

Sorry if you got offended, that wasn’t my purpose.

1 Like

Yeah you completely right found a solution:
adjusting the ensure order, I noticed it follows the nearly same order in server.cfg

Don’t worry, we all have mistakes with the translator hahaha :smiley:

1 Like

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