for loop mucking up again
#1



ok well i been programming a bit again and ran into a weird issue with 1 of my for bugs
Код:
new IsPlayerWorking[ MAX_PLAYERS ];


public othercounting()
{
	if (dtime > 0)
	{
		new str[5];
 		format(str, sizeof str, "~w~%d", dtime);
		for( new i = 0; i <= MAX_PLAYERS; i ++ ) // ISSUE IS HERE WITH MAX_PLAYERS
		{
			if (IsPlayerWorking[i])
			{
				GameTextForPlayer(i, str, 2500, 3);
 			}
		}
		dtime --;
		dtimer = SetTimer("othercounting", 1000, 0);
	}
for some reason, if i have i < MAX_PLAYERS it works, but i assume that means it would leave out the last player. i have tried i <= MAX_PLAYERS and i < MAX_PLAYERS+1 but neither work. am i doing something wrong or am i missing the point?
Reply


Messages In This Thread
for loop mucking up again - by kazai - 30.07.2009, 05:19
Re: for loop mucking up again - by paytas - 30.07.2009, 05:22
Re: for loop mucking up again - by Joe Staff - 30.07.2009, 05:39
Re: for loop mucking up again - by -Sneaky- - 30.07.2009, 06:22

Forum Jump:


Users browsing this thread: 1 Guest(s)