Count++ problem
#1

Well it shows wrong values in textdraw

Code:
forward CountBar(playerid);
public CountBar(playerid)
{
	new string[5];
	BarCount++;
	SetPlayerProgressBarValue(playerid, Bar, BarCount);
	format(string,sizeof(string),"%i",BarCount);
    PlayerTextDrawSetString(playerid,Capture[playerid],string);
	return 1;
}
Reply
#2

What values is it showing, an what values is it meant to show?
Reply
#3

What values does it give?

What is the default value?

Why did you make a PLAYER progress bar without using [playerid]?("bar" is your's, should be "bar[playerid]" or something like that).
Reply
#4

Timer[playerid][CAPZONE] = SetTimerEx("CAPZONETimer", 30000, false,"i",playerid);
CountBarTimer = SetTimerEx("CountBar", 1000, true, "i", playerid);

stock CAPZONECaptured(playerid)
{

GangZoneCaptured[playerid][CAPZONE] = 1;
UnderAttack[CAPZONE] = 0;
KillTimer(Timer[playerid][CAPZONE]);
KillTimer(CountBarTimer);

Its a timer and its stops when 30 secs are completed,it should show 1 to 30 and default value is 0 but its showing values like 1042040 etc and about that playerid thing i am using progressbar2 by southclaw so it uses per player bars
Reply
#5

What I would do is run the CountBar timer only, run it every 1 sec just like you do now, make a check inside the timer that checks if the BarCount = 30, if it is, you kill the timer and do the stuff the 30s timer does now.

as for the playerprogressbar2, I've noticed you use that, still you should use per-player variables, as it'll mess up with the variables as soon as 2 players are capturing a zone.
Reply
#6

You don't understand me i am just using 1 zone for learning i know it will bug if 2 players are capturing 2 zones but i am just making 1 zone to learn making bars etc and my problem is not zone related its count related what i mean is it shows wrong value in textdraw it should count from 1 to 30 seconds if player is capturing but it is showing numbers like 104240 140243 etc,thats my problem
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)