[HELP]Loop and count players
#1

Can somebody please tell me if this piece of code will work? Because I ain't sure and don't have time to test it and I ain't so good in scripting. I wanted that the server checks if 2 or more players are in some area and if there are, do something.... If 0 or 1 player is in area it suppose to do nothing. Here is what I got.
Код:
  	new count = 0;
		for(new i=0; i<=MAXPLAYERS; i++)
		{
 			if(IsPlayerConnected(i)) count++;
 			if((IsPlayerInArea(bla, bla, bla, bla) && ((count) >= 2));
 			{
 			  //Do something if at least 2 players are in area...
 				return 1;
			}
		}
Reply


Messages In This Thread
[HELP]Loop and count players - by [HT]playstation - 16.01.2010, 11:28
Re: [HELP]Loop and count players - by [HiC]TheKiller - 16.01.2010, 11:50
Re: [HELP]Loop and count players - by [HT]playstation - 16.01.2010, 12:00

Forum Jump:


Users browsing this thread: 2 Guest(s)