04.03.2014, 06:17
Ok, so I have just gotten the updated version of Progress Bar 1.3.1 from GitHub!
And yes, the bar is saved to the players data variables, and I know that is set up CORRECT.
The problem?
The bar doesn't even show!
MY CODE
pawn Код:
#include <progressbars> //Obviuosly it needs included.
//The Progress Bar Per-Player Timer
new SpyBarUpdateTimer[MAX_PLAYERS];
//OnPlayerConnect
pData[playerid][SpyBar] = CreatePlayerProgressBar(playerid, 100, 100, 55.5, 3.2, COLOR_BLACK, 100.0);
//OnPlayerSpawn
UpdatePlayerProgressBar(playerid, pData[playerid][SpyBar]);
//OnPlayerKeyState
if(PRESSED(KEY_CROUCH))
{
KillTimer(SpyBarUpdateTimer[playerid]);
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
{
if(GetPlayerProgressBarValue(playerid, pData[playerid][SpyBar]) > float(5))
{
foreach(Player, i) ShowPlayerNameTagForPlayer(playerid, i, false);
SetPlayerColor(playerid, (GetPlayerColor(playerid) & 0xFFFFFF00));
}
SpyBarUpdateTimer[playerid]=SetTimerEx("SpyBarUpdate", 20, 1, "ui", playerid, 0);
}
else
{
foreach(Player, i) ShowPlayerNameTagForPlayer(playerid, i, true);
SetPlayerColor(playerid, (GetPlayerColor(playerid) & 0xFFFFFFFF));
SpyBarUpdateTimer[playerid]=SetTimerEx("SpyBarUpdate", 20, 1, "ui", playerid, 1);
}
}
//My Increase/Decrease Callback/Timer
forward SpyBarUpdate(playerid, mode);
public SpyBarUpdate(playerid, mode)
{
if(mode == 0)
{
if(GetPlayerProgressBarValue(playerid, pData[playerid][SpyBar]) != 0)
SetPlayerProgressBarValue(playerid, pData[playerid][SpyBar], GetPlayerProgressBarValue(playerid, pData[playerid][SpyBar])-1.0);
else
{
foreach(Player, i) ShowPlayerNameTagForPlayer(playerid, i, true);
SetPlayerColor(playerid, (GetPlayerColor(playerid) & 0xFFFFFFFF));
KillTimer(SpyBarUpdateTimer[playerid]);
}
}
else if(mode == 1)
SetPlayerProgressBarValue(playerid, pData[playerid][SpyBar], GetPlayerProgressBarValue(playerid, pData[playerid][SpyBar])+1.0);
if(GetPlayerProgressBarValue(playerid, pData[playerid][SpyBar]) >= 100) KillTimer(SpyBarUpdateTimer[playerid]);
UpdatePlayerProgressBar(playerid, pData[playerid][SpyBar]);
}