Get # of players online?
#10

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
There's no SA-MP function to count how many players are online, but you can easily create one.

pawn Код:
stock CountPlayersOnline() {
    new
        iCount;
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) iCount++;
    }
   
    return iCount;
}
ok... so.. if i wanted to use this, i would write CountPlayersOnline(); and then printf("players online: %i", iCount); in a timer that has an interval of 10000 or something?
Reply


Messages In This Thread
Get # of players online? - by sciman001 - 18.03.2011, 20:05
Respuesta: Get # of players online? - by Alex_Obando - 18.03.2011, 20:06
Re: Get # of players online? - by sciman001 - 18.03.2011, 20:07
Re: Get # of players online? - by Calgon - 18.03.2011, 20:08
Re: Get # of players online? - by Biesmen - 18.03.2011, 20:09
Re: Get # of players online? - by Jochemd - 18.03.2011, 20:09
Re: Get # of players online? - by sciman001 - 18.03.2011, 20:15
Re: Get # of players online? - by Biesmen - 18.03.2011, 20:17
Re: Get # of players online? - by Calgon - 18.03.2011, 20:21
Re: Get # of players online? - by sciman001 - 19.03.2011, 15:11

Forum Jump:


Users browsing this thread: 1 Guest(s)