d0p3t / fivem-js

Javascript and Typescript wrapper for the FiveM natives API
https://d0p3t.nl
Other
143 stars 57 forks source link

[BUG] TimerBar - Progress not display #42

Closed grdlo closed 3 years ago

grdlo commented 3 years ago

Describe the bug The Progress of TimerBar are not showed

To Reproduce The used code is :

const bar = new Cfx.Timerbar("Soif 💧", true)
bar.Progress(0.5)
bar.Visible(true)

(i'm currently using the latest version of fivem-js)

Screenshots screenshot

FiveM Client (please complete the following information):

FiveM Server:

d0p3t commented 3 years ago

This may be a bug due to changes on how the timer bars are displayed. I will look into it, thanks

d0p3t commented 3 years ago

I could not reproduce the bug. There seems to be an issue with your code as well. bar.Progress and bar.Visible are properties, not functions. By default a timerbar is visible, so there's also not a reason to set it to true.

https://i.imgur.com/sN81QaU.png

const bar = new Cfx.Timerbar('Soif 💧', true);
bar.Progress = 0.5;
bar.Visible = true;

See https://d0p3t.nl/classes/timerbar.html#progress