Help with a loop. [EASY]
#6

Quote:
Originally Posted by Schneider
View Post
@Jimmy:
- His code has proper indentation
- The 'random words' like "goto" and "do" are valid functions. https://sampwiki.blast.hk/wiki/Control_Structures#do-while

@Xysiaris:
You forgot to add the IsPlayerConnected(i) function.
I did add it on my real code it looks like this:

pawn Code:
new i;
i = 0;
loop:
if(i > MAX_PLAYERS) goto loop_stop;
if(something == 1 && isPlayerConnected(i) == 1)
{
   //do something
   i++;
   goto loop;
}
else
{
   i++;
   goto loop;
}
loop_stop:
//do something
return 1;
But it still counts to 500 and only then breaks instead of counting to 1 (or the number of players online on the server).
Reply


Messages In This Thread
Help with a loop. [EASY] - by $Marco$ - 04.03.2015, 13:02
Re: Help with a loop. [EASY] - by Jimmy0wns - 04.03.2015, 13:08
Re : Re: Help with a loop. [EASY] - by $Marco$ - 04.03.2015, 13:12
Re: Help with a loop. [EASY] - by Schneider - 04.03.2015, 13:15
Re : Help with a loop. [EASY] - by Golimad - 04.03.2015, 13:17
Re : Re: Help with a loop. [EASY] - by $Marco$ - 04.03.2015, 13:18
Re : Help with a loop. [EASY] - by Golimad - 04.03.2015, 13:20
Re : Help with a loop. [EASY] - by $Marco$ - 04.03.2015, 13:22
Re : Help with a loop. [EASY] - by Golimad - 04.03.2015, 13:26
Re: Re : Help with a loop. [EASY] - by $Marco$ - 04.03.2015, 13:28

Forum Jump:


Users browsing this thread: 5 Guest(s)