Counting Players Problem
#10

Quote:
Originally Posted by [MWR]Blood
Посмотреть сообщение
Why the hell do you need such a complicated code for this... it can be done with just 3 lines.
pawn Код:
new counter = 0;

//under OnPlayerConnect
counter++;

//under OnPlayerDisconnect
counter--;
The code isn't complicated.

pawn Код:
#define for2(MAX_PLAYERS,%1) for(new %1=0;%1<MAX_PLAYERS;%1++) if(IsPlayerConnected(%1))

new
    str[156],
    counter
;
    for2(MAX_PLAYERS,i) counter++;
    if(counter <= 2) return SendClientMessage(playerid, -1, "There are currently no players in the server!");
    format(str, sizeof(str), "There is current %d players online in the server", counter-1);
    SendClientMessage(playerid,-1, str);
Reply


Messages In This Thread
Counting Players Problem - by GAMER_PS2 - 28.11.2011, 08:23
Re: Counting Players Problem - by System64 - 28.11.2011, 08:31
Re: Counting Players Problem - by [MWR]Blood - 28.11.2011, 08:34
Re: Counting Players Problem - by Michael@Belgium - 28.11.2011, 08:37
Re: Counting Players Problem - by System64 - 28.11.2011, 08:40
Re: Counting Players Problem - by Michael@Belgium - 28.11.2011, 08:44
Re: Counting Players Problem - by GAMER_PS2 - 28.11.2011, 08:48
Re: Counting Players Problem - by [L3th4l] - 28.11.2011, 08:54
Re: Counting Players Problem - by System64 - 28.11.2011, 09:01
Re: Counting Players Problem - by Sinc - 28.11.2011, 09:38

Forum Jump:


Users browsing this thread: 1 Guest(s)