Southclaws / progress2

A SA:MP UI library for rendering progress bars used to visualise all manner of data from health to a countdown timer.
67 stars 64 forks source link

Initial moving bar issue. #16

Open kylesmith09 opened 8 years ago

kylesmith09 commented 8 years ago

https://www.youtube.com/watch?v=6WNmz0wmJy0

At around the 3 second mark when I start the ProgressBar, it goes minus the min value. It looks like -2 or something.

This is my code, I've added checks to see the value of the bar and there's nothing negative.

http://pastebin.com/Ysk6Ckmh

Crayder commented 8 years ago

Show your create line for ServerAccounts[i][ProgressBar]

Also, float's should ALWAYS be represented with a decimal. if(next > 100) { next = 100; } should be if(next > 100.0) { next = 100.0; }

Also, that foreach notation is deprecated. The correct notation now is foreach(new i: Player).

kylesmith09 commented 8 years ago

Thanks for your recommendation @Crayder - I've gone and addressed what you have highlighted.

Unfortunately it still hasn't fixed this issue but thanks for helping with my coding best practice.

Crayder commented 8 years ago

Those things I addressed weren't for the problem at hand, I was just trying to help you out.

But you didn't do this:

Show your create line for ServerAccounts[i][ProgressBar]

kylesmith09 commented 8 years ago

@Crayder

ServerAccounts[playerid][ProgressBar] = CreatePlayerProgressBar(playerid, 125.04, 315.52, 55.5, 4.1, 0x11acffFF, 100.0, BAR_DIRECTION_RIGHT);