Count Players In Server
#1

Will this stock function i made work?

pawn Код:
stock CountPlayers()
{
  new count = 0;
  for (new i = 0; i < MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
      count++;
    }
  }
  return count;
}
Thanks!
Reply
#2

Yes
Reply
#3

k thanks
Reply
#4

Why did you open a thread for that? couldn't you just check :S?
Reply
#5

yah, but sometimes it works but i didnt do something right which lead to errors further on :S
Reply
#6

pawn Код:
new Players;

public OnPlayerConnect(playerid)
{
  Players++;
  return 1;
}

public OnPlayerDisconnect(playerid,reason)
{
  Players--;
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)