GetTickCount and ShowPlayerProgressBar
#1

well i've to issues i hope someone would help me with (+rep)
so the first one is when i use jetpack everytime it says you used it recently..
new jetpacktimer[MAX_PLAYERS];
Quote:

CMD:jetpack(playerid, params)
{
if(pInfo[playerid][Class] != JET) return SendClientMessage(playerid, RED, "You need to be jettrooper to spawn a jetpack");
if(GetTickCount()-jetpacktimer[playerid] < 120000) return SendClientMessage(playerid, RED, "You have to wait 2 minutes to use this command again");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USE JETPACK);
SendClientMessage(playerid, GREEN, "Jetpack Spawned!");
jetpacktimer[playerid] = GetTickCount();
return 1;
}

the second one is the progress bar get showed for the player who capture the area..and it doesn't show for the helper who help him capturing it..any idea?!

Quote:

new PlayerBar:zonebar[MAX_PLAYERS];

Quote:

public CapturingArea(playerid,Area,CTimer)
{
if(IsPlayerCapturing[playerid]{ Area })
{
CountVar[Area]=CountVar[Area]+1;
SetPlayerProgressBarValue(playerid, PlayerBar:zonebar[playerid], CountVar[Area]);
ShowPlayerProgressBar(playerid, PlayerBar:zonebar[playerid]);
format(str, SOS, "%i",CountVar[Area]);
PlayerTextDrawSetString(playerid, capture0[Area], str);
PlayerTextDrawShow(playerid, capture0[Area]);
}
else if(IsPlayerHelping[playerid]{ Area })
{
CountVar[Area]=CountVar[Area]+1;
SetPlayerProgressBarValue(playerid, PlayerBar:zonebar[playerid], CountVar[Area]);
ShowPlayerProgressBar(playerid, PlayerBar:zonebar[playerid]);
format(str, SOS, "%i",CountVar[Area]);
PlayerTextDrawSetString(playerid, capture0[Area], str);
PlayerTextDrawShow(playerid, capture0[Area]);
SendClientMessage(playerid,RED,"[DEBUG]:YOU ARE HELPING CALLED SUCCESSFULLY!");
}
if(CountVar[Area]>=CTimer && IsPlayerCapturing[playerid]{ Area })
{
FinishCaptureArea(playerid,Area );
}
return 1;
}

NOTE:i create the progress bar under a function which is called after onplayerenterdynamicCP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)