[HELP]Loop and count players
#3

Thank you. But are you sure that that will work 100%? I have to make sure...

Because i just thought of this-
Код:
if(IsPlayerConnected(i)) count++;
I think this will count player's who are connected and not the players who are in area. So maybe it will check if that player is player in area && count how many player's are online. So I think that won't be right. So maybe it should be like this, no?
Код:
new count = 0;
for(new i=0; i<=MAXPLAYERS; i++)
{
 	if(IsPlayerInArea(bla, bla, bla, bla) count++;
 	if((IsPlayerInArea(bla, bla, bla, bla) && count >= 2)
 	{
 	  //Do something if at least 2 players are in area...
 	  return 1;
    }
}
EXPLANATION: if a player is in area count +1. Then another one comes +1. And if there are 2 or more, do something...
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: 1 Guest(s)