View Single Post
Old 15/05/2016, 12:53 PM   #5
BizzyD's Avatar
Join Date: Jan 2011
Location: Home
Posts: 879
Reputation: 66
Default Re: Progressbar refuses to destroy

Originally Posted by AndreT View Post
	ShowPlayerProgressBar(playerid, UnfreezeBar[playerid]);
	UnfreezeBar[playerid] = CreatePlayerProgressBar(playerid,258.00, 367.00, 124.50, 14.50, -16776961, 100.0);
Looking at the code... you first show a progress bar the ID of which is in the UnfreezeBar array. Then you create a new one (CreatePlayerProgressBar returns a value and it is written into the UnfreezeBar array).

Therefore, in the unfreezetimer, you actually hide the NEWLY CREATED progress bar, but the one that you show earlier still remains.

Extra suggestion to make: If you already store the progression value in the UnfreezeProgress array, why call GetPlayerProgressBarValue from some libary (you're not sure what's the overhead of this function). Furthermore, the library most likely already stores the progression value on its own. Therefore it is unnecessary to keep a copy of this array in your own script.
You can optimize your memory usage by not keeping a local copy of your own if the library provides these functions (and you use them anyway, currently).
That solved it, thanks mate.
We never fail, we only shine with brilliance. One king one faith one religion. And if you hear me come and join the revolution
BizzyD is offline   Reply With Quote