View Single Post
Old 14/05/2016, 09:32 PM   #1
BizzyD
Gangsta
 
BizzyD's Avatar
 
Join Date: Jan 2011
Location: Home
Posts: 879
Reputation: 66
Default Progressbar refuses to destroy

Hey, I'm working with progressbar that "loads". And when its finished loading it wont go away.
Here is the code:

Code:
stock freeze(playerid)
{
	TogglePlayerControllable(playerid, 0);
	ShowPlayerProgressBar(playerid, UnfreezeBar[playerid]);
	UnfreezeBar[playerid] = CreatePlayerProgressBar(playerid,258.00, 367.00, 124.50, 14.50, -16776961, 100.0);
	UnfreezeBarUpdater[playerid] = SetTimerEx("unfreezetimer", 1000, true, "i", playerid);
	GameTextForPlayer(playerid, "~r~Loading Objects", 3000, 5);
}
public DeleteBar(playerid)
{
    DestroyPlayerProgressBar(playerid,UnfreezeBar[playerid]);
    UnfreezeProgress[playerid] = 0;
    return 1;
}

public unfreezetimer(playerid)
{
    if(GetPlayerProgressBarValue(playerid,UnfreezeBar[playerid]) == 100)
    {
        DestroyPlayerProgressBar(playerid,UnfreezeBar[playerid]);
		UnfreezeProgress[playerid] = 0;
		SetTimerEx("DeleteBar", 2000, true, "i", playerid);
		TogglePlayerControllable(playerid, 1);
		GameTextForPlayer(playerid, "~g~Done",2000, 5);
		return true;
	}
	UnfreezeProgress[playerid] += 25;
    SetPlayerProgressBarValue(playerid,UnfreezeBar[playerid], UnfreezeProgress[playerid]);
	return true;
}
Even tried adding the DeleteBar timer to it, but still nothing.
Anyone have an idea whats wrong?
__________________
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